#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, min = 0, max = 0, k = 6;
  cin >> n;
  for (int i = 7; i <= n + 1; i = i + 7) {
    min = min + 2;
    if (n == i - 1) min--;
  }
  for (int j = 2; j <= n + 1; j = j + 7) {
    max = max + 2;
    if (n == j - 1) max--;
  }
  cout << min << " " << max << endl;
}
