#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (~scanf("%d", &n)) {
    int minn, maxx;
    if (n == 1) {
      cout << "0 1" << endl;
      continue;
    } else if (n <= 5) {
      cout << "0 2" << endl;
      continue;
    }
    minn = n / 7 * 2;
    if (n % 7 == 6) {
      minn += 1;
    }
    maxx = n / 7 * 2;
    if (n % 7 < 2) {
      maxx += n % 7;
    } else if (n % 7 >= 2) {
      maxx += 2;
    }
    cout << minn << " " << maxx << endl;
  }
  return 0;
}
