#include <bits/stdc++.h>
using namespace std;
long long fx[4] = {1, -1, 0, 0};
long long fy[4] = {0, 0, 1, -1};
int main() {
  long long n;
  while (cin >> n) {
    long long d = n % 7;
    n = n / 7;
    if (d == 0)
      cout << n * 2 << " " << n * 2 << "\n";
    else if (d == 1)
      cout << n * 2 << " " << (n + 1) * 2 - 1 << "\n";
    else if (d < 6)
      cout << n * 2 << " " << (n + 1) * 2 << "\n";
    else
      cout << n * 2 + 1 << " " << (n + 1) * 2 << "\n";
  }
  return 0;
}
