#include <iostream> int main() { int n; std::cin >> n; int res = n; while (n > 2) { res += n / 3; n = n / 3 + n % 3; } std::cout << res << std::endl; return 0; }