#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a, b;
  a = (n / 7) * 2 + (n % 7 >= 2 ? 2 : (n % 7 >= 1 ? 1 : 0));
  b = (n / 7) * 2 + (n % 7 <= 5 ? 0 : 1);
  cout << b << " " << a << endl;
  return 0;
}
