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