#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d, mn, mx, r;
  cin >> n;
  d = n / 7;
  mn = mx = 2 * d;
  r = n % 7;
  if (r == 6) mn++;
  if (r == 1)
    mx++;
  else if (r >= 2)
    mx += 2;
  cout << mn << " " << mx << endl;
  return 0;
}
