You are given an array of numbers with n elements.
You can perform the following operation on the array:
You must make all the values of the array elements the same with a minimum number of operations.
In the first line, a natural number n(1≤n≤5∗105).
In the second line, the elements of the array ai(1≤ai≤5∗105).
In the third line, three distinct natural numbers a,b,c(1≤a,b,c≤4).
Output the minimum number of operations in one line.
3 2 8 5 1 2 4
3
7 3 9 8 7 8 7 10 2 4 3
5
10 4 6 7 1 13 15 15 13 16 1 3 1 2
7