#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  cin >> n;
  cout << abs(ceil((n - 5) / 7.0) * 2) - (n % 7 == 6) << " "
       << abs(floor((n + 5) / 7.0) * 2) + (n % 7 == 1) << endl;
}
