#include <bits/stdc++.h>
using namespace std;
long long t, n, m, u, v, q, r, ql, qr, k, l, s, w, z, x, y, d, p, c;
const int N = 1e5 + 500;
const int NN = N + N + N;
const int LN = 21;
const long long mod = 1e9 + 7;
const long long INF = 1LL << 52LL;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  long long sol = (n / 7) * 2;
  long long x = n % 7;
  cout << sol + max(0LL, x - 5) << '\n';
  cout << sol + min(2LL, x) << '\n';
  return 0;
}
