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