#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  int n, mn, mx;
  cin >> n;
  if (n % 7 == 6) {
    mn = ((n / 7) * 2) + 1;
  } else {
    mn = (n / 7) * 2;
  }
  if (n % 7 == 1) {
    mx = mn + 1;
  } else if (n % 7 >= 2) {
    if (n % 7 == 6)
      mx = mn + 1;
    else
      mx = mn + 2;
  } else
    mx = mn;
  cout << mn << " " << mx << endl;
}
