#include <cstdio>
#include <iostream>
#include <assert.h>
#include <cmath>

using namespace std;

int main()
{
    freopen("dices.in", "r", stdin);
    freopen("dices.out", "w", stdout);
    long long n;
    cin >> n;
    assert(1 <= n && n <= 1e9);
    long long mi = 1e9, ma = 6 * n;
    for (long long k = 0; k <= n; k++)
        if (k * 6 >= n) mi = min(mi, k * 7 - n); 
    cout << mi << " " << ma << endl;
}