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