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