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