#include #define rep(i,a,n) for (int i = a;i < n;i++) using namespace std; int main() { long n,ans=0; cin >> n; rep(i,1,n+1) { if(i % 3 == 0 && i % 5 ==0){ ans += 4; }else if(i%3 == 0){ ans += 2; }else if(i % 5 == 0) { ans += 2; } } cout << ans << endl; }