import java.util.Scanner; public class PracticalFizbuzz { static Scanner scan = new Scanner(System.in); public static void main(String[] args) { int count = 1; int numbercount = 0; int N = scan.nextInt(); int a = scan.nextInt(); int b = scan.nextInt(); int c = scan.nextInt(); while(count<=N){ if(count%a==0){ numbercount++; count++; continue; } if(count%b==0){ numbercount++; count++; continue; } if(count%c==0){ numbercount++; count++; continue; } count++; } System.out.println(numbercount); } }