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