#include <bits/stdc++.h>
using namespace std;
int main() {
  long long num;
  cin >> num;
  if (num % 7 == 0) {
    cout << (num / 7) * 2 << " " << (num / 7) * 2 << endl;
  } else {
    if (num % 7 == 6) {
      cout << ((num / 7) * 2) + 1 << " ";
    } else {
      cout << (num / 7) * 2 << " ";
    }
    if (num % 7 >= 2) {
      cout << (2 * (num / 7)) + 2 << endl;
    } else {
      cout << (2 * (num / 7)) + 1 << endl;
    }
  }
  return 0;
}
