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