#include <bits/stdc++.h>
int main() {
  int n, mx, mn, rem, div;
  scanf("%d", &n);
  if (n == 6) printf("1 2\n");
  div = n / 7;
  rem = n % 7;
  mn = div * 2;
  if (rem >= 2)
    mx = (div * 2) + 2;
  else if (rem == 0)
    mx = div * 2;
  else
    mx = (div * 2) + 1;
  if (rem == 6) mn = mn + 1;
  if (n != 6) printf("%d %d\n", mn, mx);
  return 0;
}
