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