#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n, a, b;
  cin >> n;
  if (n < 2)
    cout << "0 1";
  else {
    if (n % 7 == 6)
      a = (((n + 1) / 7) * 2) - 1;
    else
      a = ((n / 7)) * 2;
    if (n % 7 == 1)
      b = ((((n - 1) / 7) + 1) * 2) - 1;
    else {
      b = (int)ceil(n / 7.0);
      b = b * 2;
    }
    cout << a << " " << b;
  }
  return 0;
}
