#include <bits/stdc++.h>
using namespace std;
struct debugger {
  static void call(string::iterator it, string::iterator ed) {}
  template <typename T, typename... aT>
  static void call(string::iterator it, string::iterator ed, T a, aT... rest) {
    string b;
    for (; *it != ','; ++it)
      if (*it != ' ') b += *it;
    cout << b << "=" << a << " ";
    call(++it, ed, rest...);
  }
};
int main() {
  {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
  }
  int n;
  cin >> n;
  int i = (n / 7) * 2, j = n % 7;
  cout << i + (j > 5 ? 1 : 0) << " " << i + (j >= 2 ? 2 : j ? 1 : 0) << '\n';
}
