#include <bits/stdc++.h>
using namespace std;
int fun(int n) { return (n / 7) * 2 + ((n % 7) / 6); }
int main() {
  int n;
  cin >> n;
  cout << fun(n) << " ";
  (n == 1) ? cout << 1 : cout << 2 + fun(n - 2);
}
