PROGRAMMING:MT
###Task description
```
Xiaochen has installed a machine translation software on his computer, which he often uses to translate English articles.
The principle of this translation software is very simple. It just replaces each English word with the corresponding Chinese meaning from beginning to end. For each English word, the software will first find the Chinese meaning of the word in memory. If there is one in memory, the software will use it for translation; If not in memory, the software will search in the dictionary in external memory, find out the Chinese meaning of the word, then translate it, and put the word and translation meaning into memory for subsequent search and translation.
Suppose there are m units in memory, each unit can store a word and translation. Whenever the software stores a new word in memory, if the number of stored words in the current memory does not exceed m − 1, the software will store the new word in an unused memory unit; If M words have been stored in the memory, the software will clear the first word to enter the memory and free up the unit to store new words.
Suppose the length of an English article is n words. Given this article to be translated, how many times does the translation software need to search the dictionary in external memory? Suppose there are no words in memory before the translation begins.
```
###Input format:
```
The input file consists of 2 lines. The two numbers in each line are separated by a space.
The first line is two positive integers m and N, representing the memory capacity and the length of the article.
The second line is n non negative integers. According to the order of the article, each number (no more than 1000) represents an English word. Two words in the article are the same word if and only if their corresponding non negative integers are the same.
For 10% of the data, M = 1, n ≤ 5.
For 100% data, 0 < m ≤ 100, 0 < n ≤ 1000.
```
###Output format:
```
A total of 1 line, including an integer, is the number of times the software needs to look up the dictionary.
```
###Input example:
```in
3 7
1 2 1 5 4 4 1
```
###Output example:
```out
five
```
###Input example:
```in
2 10
8 824 11 78 11 78 11 78 8 264
```
###Output example:
```out
six
```
###Tips
```
I / O sample 1 Description:
The whole process of looking up the dictionary is as follows: each line represents the translation of a word, and the memory status after the translation is before the colon
Empty: the initial state of memory is empty.
1.1: find word 1 and transfer it into memory.
2.1 2: find word 2 and call it into memory.
3.1 2: find word 1 in memory.
4.1 2 5: find word 5 and transfer it into memory.
5.2 5 4: find word 4 and transfer it into memory instead of word 1.
6.2 5 4: find word 4 in memory.
7.5 4 1: find word 1 and transfer it into memory instead of word 2.
Five times in total.
```
###Title Source
This topic is selected from openjudge website http://noi.openjudge.cn/ch0112/01/
answer:If there is no answer, please comment
```
Xiaochen has installed a machine translation software on his computer, which he often uses to translate English articles.
The principle of this translation software is very simple. It just replaces each English word with the corresponding Chinese meaning from beginning to end. For each English word, the software will first find the Chinese meaning of the word in memory. If there is one in memory, the software will use it for translation; If not in memory, the software will search in the dictionary in external memory, find out the Chinese meaning of the word, then translate it, and put the word and translation meaning into memory for subsequent search and translation.
Suppose there are m units in memory, each unit can store a word and translation. Whenever the software stores a new word in memory, if the number of stored words in the current memory does not exceed m − 1, the software will store the new word in an unused memory unit; If M words have been stored in the memory, the software will clear the first word to enter the memory and free up the unit to store new words.
Suppose the length of an English article is n words. Given this article to be translated, how many times does the translation software need to search the dictionary in external memory? Suppose there are no words in memory before the translation begins.
```
###Input format:
```
The input file consists of 2 lines. The two numbers in each line are separated by a space.
The first line is two positive integers m and N, representing the memory capacity and the length of the article.
The second line is n non negative integers. According to the order of the article, each number (no more than 1000) represents an English word. Two words in the article are the same word if and only if their corresponding non negative integers are the same.
For 10% of the data, M = 1, n ≤ 5.
For 100% data, 0 < m ≤ 100, 0 < n ≤ 1000.
```
###Output format:
```
A total of 1 line, including an integer, is the number of times the software needs to look up the dictionary.
```
###Input example:
```in
3 7
1 2 1 5 4 4 1
```
###Output example:
```out
five
```
###Input example:
```in
2 10
8 824 11 78 11 78 11 78 8 264
```
###Output example:
```out
six
```
###Tips
```
I / O sample 1 Description:
The whole process of looking up the dictionary is as follows: each line represents the translation of a word, and the memory status after the translation is before the colon
Empty: the initial state of memory is empty.
1.1: find word 1 and transfer it into memory.
2.1 2: find word 2 and call it into memory.
3.1 2: find word 1 in memory.
4.1 2 5: find word 5 and transfer it into memory.
5.2 5 4: find word 4 and transfer it into memory instead of word 1.
6.2 5 4: find word 4 in memory.
7.5 4 1: find word 1 and transfer it into memory instead of word 2.
Five times in total.
```
###Title Source
This topic is selected from openjudge website http://noi.openjudge.cn/ch0112/01/
answer:If there is no answer, please comment