#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, have, rem, max, min;
  cin >> n;
  have = n / 7;
  rem = n % 7;
  max = 2 * have;
  min = 2 * have;
  if (rem == 6) {
    max += 2;
    min += 1;
  } else if (rem > 1 && rem < 6) {
    max += 2;
    min += 0;
  } else
    max += rem;
  cout << min << " " << max;
}
