#include using namespace std; int main(){ int n; cin >> n; int count = 0; for(int i = 0; i < n; i++){ if(i % 15 == 0) count += 4; else if(i % 3 == 0 or i % 5 == 0) count += 2; } cout << count << endl; return 0; }