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(); int count = 0; for(int i=1; i<=N; i++) { if(i % a == 0) { count++; } else if(i % b == 0) { count++; } else if(i % c == 0) { count++; } } System.out.println(count); } }