#include <bits/stdc++.h>
using namespace std;
int main() {
  long long x;
  cin >> x;
  long long v = x % 7;
  long max_ = 0, min_ = 0;
  max_ = min_ = (x / 7) * 2;
  if (v == 0) {
    cout << max_ << " " << min_ << endl;
  } else if (v == 1) {
    cout << min_ << " " << max_ + 1 << endl;
  } else if (v == 2 || v == 3 || v == 4 || v == 5) {
    cout << min_ << " " << max_ + 2 << endl;
  } else if (v == 6) {
    cout << min_ + 1 << " " << max_ + 2 << endl;
  }
}
