#include <bits/stdc++.h>
using namespace std;
const long long N = 3e5 + 7;
long long a[N], b[N];
void solve() {
  long long n;
  cin >> n;
  long long mn = (n / 7) * 2;
  long long t = n % 7;
  cout << mn + t / 6 << " ";
  cout << mn + min(t, 2ll);
}
int32_t main() {
  long long t = 1;
  while (t--) solve(), cout << endl;
  return 0;
}
