第十三届JAVAA组决赛——5.斐波那契数组
import java.io.*;
import java.util.*;
public class Main{
public static BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));
public static PrintWriter stdOut = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
public static final int N = 100010, M = 1000010;
public static long[] arr = new long[N];
public static long[] feb = new long[N];
public static int[] multi = new int[M];
public static int n;
public static void main(String[] args) throws IOException{
n = Integer.parseInt(stdIn.readLine());
String[] sp = stdIn.readLine().split(" ");
for(int i = 0; i < n; i++)
arr[i] = Long.parseLong(sp[i]);
//构造标准斐波那契数列
feb[0] = feb[1] = 1;
for(int i = 2; i < N; i++)
feb[i] = feb[i-1] + feb[i-2];
for(int i = 0; i < n; i++)
if(arr[i] % feb[i] == 0) multi[(int)(arr[i] / feb[i])]++;
Arrays.sort(multi, 0, M);
stdOut.println(n - multi[M-1]);
stdOut.flush();
}
}