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