import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); int a = scan.nextInt(); int b = scan.nextInt(); int c = scan.nextInt(); boolean flag[] = new boolean[N+1]; int check[] = { a,b,c }; for(int i=0; i<3; i++) { for(int j=check[i]; j<=N; j+=check[i]) { flag[j] = true; } } int count = 0; for(int i=1; i<=N; i++) { if(flag[i]) count++; } System.out.println(count); } }