#include <iostream>
using namespace std;
int prime_number(int n){
    int i;
    if(n<=1) return 0;
    for(i=2;i<=n/2;i++) if(n%i==0) return 0;
    return 1;
}

int main(){
    int i,j,k,n[10000],a=0;
    for(j=0;j<10000;j++){
        cin >> n[j];
        if(n[j]==0) break;
    }
    for(k=0;k<j;k++){
        for(i=n[k];i>4;i--) if(prime_number(i)) if(prime_number(i-2)){
            a=i;
            break;
        }
        if(a!=0) cout << i-2 << " " << i << endl;
    }
    return 0;
}

#include <cstdio>
#include <cstring>
#include <cmath>
#include <utility>
#include <iostream>
#include <functional>
#include <bitset>
#include <algorithm>
#include <vector>
#include <forward_list>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <numeric>
#include <iomanip>
#define ll long long int
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
using namespace std;
int mx4[] = {0,1,0,-1};
int my4[] = {1,0,-1,0};
int mx2[] = {1,0};
int my2[] = {0,1};

class CXYetAnotherDieGame {
public:
	void solve(istream& in, ostream& out) {
        ll x;
        in >> x;
        if(x <= 6) out << 1 << endl;
        else if(x % 11 > 6) out << (x / 11) * 2 + 2 << endl;
        else if(x % 11 <= 6 && x % 11 != 0) out << (x / 11) * 2 + 1 << endl;
        else if(x % 11 == 0) out << (x / 11) * 2 << endl;
	}
};

int main() {
	CXYetAnotherDieGame solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}