#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int minw = 0, maxw = 0;
  int weeks = n / 7;
  int left = n - weeks * 7;
  if (weeks == 0) {
    if (n <= 5) {
      if (n == 1)
        maxw = 1;
      else
        maxw = 2;
      minw = 0;
    } else
      minw = 1, maxw = 2;
  } else {
    minw = 2 * weeks;
    maxw = minw;
    if (left > 1)
      maxw += 2;
    else if (left > 0)
      maxw += 1;
    if (left > 5) minw++;
  }
  cout << minw << " " << maxw;
  return 0;
}
