#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  cin >> n;
  cout << (n / 7) * 2 + (n % 7 == 6 ? 1 : 0) << " ";
  int k1 = 0;
  if (n % 7 > 1)
    cout << (n / 7) * 2 + 2 << " ";
  else if (n % 7 == 1 && n)
    cout << (n / 7) * 2 + 1 << " ";
  else
    cout << (n / 7) * 2 << " ";
}
