import java.util.Scanner; class FizzBuzzString { public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); long n= stdIn.nextLong(); long z = 0; for ( long i = 0; i < n; i++ ) { if ( i % 3 == 0 && i % 5 == 0 ) { z += 4; } else { if ( i % 3 == 0 ) { z += 2; } if ( i % 5 == 0 ) { z += 2; } } } System.out.println(z); } }