#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int w = n / 7;
  int h = n % 7;
  int p = 2 * w + (h == 6 ? 1 : 0);
  int q = 2 * w + min(h, 2);
  cout << p << " " << q;
}
