#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cin.tie(0);
  int n, m;
  cin >> n;
  int x = n / 7;
  n %= 7;
  if (n != 6) {
    m = 2 * x;
    cout << 2 * x << " ";
  } else if (n == 6) {
    m = 2 * x + 1;
    cout << 2 * x + 1 << " ";
  }
  if (n >= 2) {
    cout << 2 * x + 2 << endl;
  } else if (n == 1) {
    cout << 2 * x + 1 << endl;
  } else if (n == 2) {
    cout << 2 * x + 2 << endl;
    ;
  } else {
    cout << m << endl;
  }
}
