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