#include #include #include #include #include using namespace std; long long a[15] = {0, 0, 2, 0, 4, 6, 6, 6, 6, 8, 10, 10, 12, 12, 12}; int main(void) { long long N; cin >> N; long long base = 16; cout << N / 15 * base + a[N % 15] << endl; return 0; }