Rick and Morty want to find MR. PBH and they can't do it alone. So they need of Mr. Meeseeks. They Have generated *n* Mr. Meeseeks, standing in a line numbered from 1 to *n*. Each of them has his own color. *i*-th Mr. Meeseeks' color is *a*<sub class="lower-index">*i*</sub>. 

Rick and Morty are gathering their army and they want to divide Mr. Meeseeks into some squads. They don't want their squads to be too colorful, so each squad should have Mr. Meeseeks of at most *k* different colors. Also each squad should be a continuous subarray of Mr. Meeseeks in the line. Meaning that for each 1 ≤ *i* ≤ *e* ≤ *j* ≤ *n*, if Mr. Meeseeks number *i* and Mr. Meeseeks number *j* are in the same squad then Mr. Meeseeks number *e* should be in that same squad.

Also, each squad needs its own presidio, and building a presidio needs money, so they want the total number of squads to be minimized.

Rick and Morty haven't finalized the exact value of *k*, so in order to choose it, for each *k* between 1 and *n* (inclusive) need to know the minimum number of presidios needed.
The first line of input contains a single integer *n* (1 ≤ *n* ≤ 10<sup class="upper-index">5</sup>) — number of Mr. Meeseeks.

The second line contains *n* integers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub> separated by spaces (1 ≤ *a*<sub class="lower-index">*i*</sub> ≤ *n*) — colors of Mr. Meeseeks in order they standing in a line.
For the first sample testcase, some optimal ways of dividing army into squads for each *k* are:
 1.  [1], [3], [4], [3, 3] 1.  [1], [3, 4, 3, 3] 1.  [1, 3, 4, 3, 3] 1.  [1, 3, 4, 3, 3] 1.  [1, 3, 4, 3, 3] 
For the second testcase, some optimal ways of dividing army into squads for each *k* are:
 1.  [1], [5], [7], [8], [1], [7], [6], [1] 1.  [1, 5], [7, 8], [1, 7], [6, 1] 1.  [1, 5, 7], [8], [1, 7, 6, 1] 1.  [1, 5, 7, 8], [1, 7, 6, 1] 1.  [1, 5, 7, 8, 1, 7, 6, 1] 1.  [1, 5, 7, 8, 1, 7, 6, 1] 1.  [1, 5, 7, 8, 1, 7, 6, 1] 1.  [1, 5, 7, 8, 1, 7, 6, 1]
5
1 3 4 3 3
4 2 1 1 1 
8
1 5 7 8 1 7 6 1
8 4 3 2 1 1 1 1 
10
4 1 2 6 8 5 3 9 3 9
10 4 3 2 2 2 2 1 1 1 
85
23 11 69 1 49 10 7 13 66 35 81 4 51 2 62 55 31 18 85 34 59 44 20 28 27 5 6 79 43 78 45 64 61 56 12 40 54 52 24 14 26 65 75 72 30 46 67 80 38 70 25 60 50 8 17 84 41 71 58 76 19 47 73 29 3 48 82 33 39 63 15 37 83 36 9 32 16 57 68 53 21 77 22 42 74
85 43 29 22 17 15 13 11 10 9 8 8 7 7 6 6 5 5 5 5 5 4 4 4 4 4 4 4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 
100
39 78 71 61 54 13 17 81 30 33 83 98 44 10 45 87 75 47 70 84 41 86 49 94 85 91 37 64 5 56 67 79 28 89 50 53 77 93 81 14 97 67 58 6 48 60 89 62 29 3 38 8 88 19 66 63 100 17 43 97 21 12 58 76 2 78 25 73 99 11 27 18 57 46 4 72 68 45 74 18 2 80 51 52 42 59 55 35 1 95 42 92 36 40 59 15 7 21 97 53
100 50 34 25 20 17 15 13 11 10 10 9 8 7 7 6 6 6 6 5 5 5 5 4 4 4 4 4 4 4 4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 
1
1
1 
print("_RANDOM_GUESS_1689168029.412819")# 1689168029.412853