#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, r, t, mn, max;
  cin >> n;
  r = n % 7;
  t = n / 7;
  max = mn = t * 2;
  if (r == 6) mn++;
  if (r <= 2)
    max += r;
  else
    max += 2;
  cout << mn << " " << max << endl;
  return 0;
}
