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