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