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