#include using namespace std; int main() { long long N; cin >> N; //2*(3の倍数+5の倍数-2*15の倍数) + 4*15の倍数 long long tmp3 = N / 3; long long tmp5 = N / 5; long long tmp15 = N / 15; cout << 2 * (tmp3 + tmp5 - 2 * tmp15) + 4 * tmp15 << endl; return 0; }