#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans, m, M;
  cin >> n;
  ans = n / 7;
  ans <<= 1;
  m = n % 7 == 6 ? ans + 1 : ans;
  if (n % 7 > 1)
    M = ans + 2;
  else if (n % 7 == 1)
    M = ans + 1;
  else
    M = ans;
  cout << m << " " << M << endl;
}
