#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i;
  scanf("%d", &n);
  int re = n % 7;
  int mi = 0;
  if (re == 6) mi = 1;
  printf("%d %d", 2 * (n / 7) + mi, 2 * (n / 7) + min(2, re));
  return 0;
}
