import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String str = br.readLine(); int n = Integer.parseInt(str); str = br.readLine(); String[] dstr = str.split(" "); int[] d = new int[n]; for (int i = 0; i < n; i++) d[i] = Integer.parseInt(dstr[i]); str = br.readLine(); String[] coordinate = str.split(" "); int x = Integer.parseInt(coordinate[0]); int y = Integer.parseInt(coordinate[1]); int dst = Math.max(Math.abs(x), Math.abs(y)); d = Sort(d); if (dst == 0) System.out.println("0"); else if (dst < d[0]) System.out.println("2"); else if (dst <= d[n - 1]) { boolean flag = false; for (int dist : d) { if (dst == dist) { System.out.println("1"); flag = true; break; } } if (!flag) System.out.println("2"); } else { if (dst % d[n - 1] == 0) System.out.println(dst / d[n - 1]); else System.out.println(dst / d[n - 1] + 1); } } private static int[] Sort(int[] num) { int length = num.length; if (length == 1) return num; else if (length == 2 && num[0] > num[1]) { int tmpnum = num[0]; num[0] = num[1]; num[1] = tmpnum; } else { for (int i = 1; i < length; i++) { for (int j = 0; j < length - i; j++) { if (num[j] > num[j + 1]) { int tmpnum = num[j]; num[j] = num[j + 1]; num[j + 1] = tmpnum; } } } } return num; } }