#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 7;
const int N = 1e2 + 10;
int solve(int n) { return n / 7 * 2 + (n % 7 == 6); }
int main() {
  int n;
  cin >> n;
  cout << solve(n) << ' ' << min(2, n) + solve(n - min(2, n)) << endl;
  return 0;
}
