#include<bits/stdc++.h>
#define rep(i, n) for (long long i = 0; i < (int)(n); i++)
#define put(i) cout<<fixed<<i<<endl
using namespace std;
using ll = long long;

bool is_integer(double x){
    return std::floor(x) == x;
}

int main(){
    ll n; cin >> n;

    while(true){
        if(is_integer(sqrt(n))){
            put(n);
            return 0;
        }
        n--;
    }
}
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main(){
    ll n;
    cin >> n;
    ll ans = 0;
    ans += n/11*2;
    if(n%11 != 0) ans += (n%11-1)/6 + 1;
    cout << ans << endl;
    return 0;
}