#include <bits/stdc++.h>
using namespace std;
int main() {
  long int N;
  while (cin >> N) {
    long int rem = N % 7;
    long int div = N / 7;
    long int _min = div * 2;
    if (rem > 5) _min++;
    long int _max = div * 2;
    if (rem == 1)
      _max++;
    else if (rem >= 2)
      _max += 2;
    cout << _min << " " << _max << endl;
  }
  return 0;
}
