#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long S = n / 7 * 2, B = (n - 2) / 7 * 2 + min(n, (long long)2);
  n % 7 < 5 ? S += 0 : S += n % 7 - 5;
  (n - 2) % 7 < 5 ? B += 0 : B += (n - 2) % 7 - 5;
  cout << S << " " << B << endl;
}
