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