public class Main {
public static void main(String[] args) {
boolean[] A = new boolean[300];
for(int i = 0;i < 21;i++) {
A[i*5] = true;
}
boolean[] B = new boolean[300];
for(int i = 0;i < 21;i++) {
B[i*6] = true;
}
boolean[] C = new boolean[300];
for(int i = 0;i < 21;i++) {
C[i*7] = true;
}
int count = 0;
for(int i = 0;i < 300;i++) {
if(A[i] || B[i] || C[i]) {
count++;
}
}
System.out.println(count);
}
}