#include <bits/stdc++.h>
using namespace std;
long int n, x1, x2, c;
int main() {
  cin >> n;
  if (n == 1) x2 = 1;
  if (n == 6) {
    x1 = 1;
    x2 = 2;
  } else if (n != 1) {
    c = n - ((n / 7) * 7);
    if (n % 7 == 0) {
      x1 = (n / 7) * 2;
      x2 = (n / 7) * 2;
    } else {
      if (c == 1) {
        x1 = (n / 7) * 2;
        x2 = ((n / 7) * 2) + 1;
      } else {
        x1 = (n / 7) * 2;
        x2 = ((n / 7) * 2) + 2;
      }
    }
    if ((n + 1) % 7 == 0) x1++;
  }
  cout << x1 << " " << x2 << endl;
}
