#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int c = 0;
  c = c + (n / 7) * 2;
  int t = n % 7;
  int ma = min(2, t);
  int mi = max(0, t - 5);
  cout << c + mi << " " << c + ma;
  return 0;
}
