#include "bits/stdc++.h"
#define puba push_back
#define mapa make_pair
#define ff first
#define ss second
#define bend(_x) (_x).begin(), (_x).end()
#define szof(_x) ((int) (_x).size())

using namespace std;
typedef long long ll;
typedef double dbl;
typedef unsigned int ui;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef pair <long long, long long> pll;

int n;

int main() {    
    freopen("sapsan.in", "r", stdin);
    freopen("sapsan.out", "w", stdout);

    cin >> n;

    int ans = 0;

    for (int i = 0; i <= n; ++i) {
        if (!(i & 3) && i + (i >> 1) <= n) {
            ans = i;
        }
    }

    cout << ans << endl;

    return 0;
}