import java.util.Scanner; public class Main{ public static void main(String... args){ Scanner scan = new Scanner(System.in); long n = scan.nextLong(); int a = scan.nextInt(); int b = scan.nextInt(); int c = scan.nextInt(); System.out.println((n/a+n/b) - n/c); } }