#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int ans1 = n - (n % 7);
  int ans = ans1 / 7;
  n = n % 7;
  int arr[2] = {0, 0};
  if (n == 1) {
    arr[0] += 0;
    arr[1] += 1;
  } else if (n >= 2 && n <= 5) {
    arr[0] += 0;
    arr[1] += 2;
  } else if (n == 6) {
    arr[0] += 1;
    arr[1] += 2;
  } else if (n >= 7) {
    arr[0] += 2;
    arr[1] += 2;
  }
  cout << arr[0] + (ans * 2) << " " << arr[1] + (ans * 2) << endl;
  return 0;
}
