#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b;
  scanf("%d", &n);
  int r = n % 7;
  switch (r) {
    case 0:
      a = n / 7 * 2;
      b = n / 7 * 2;
      break;
    case 1:
      a = n / 7 * 2;
      b = n / 7 * 2 + 1;
      break;
    case 2:
    case 3:
    case 4:
    case 5:
      a = n / 7 * 2;
      b = n / 7 * 2 + 2;
      break;
    case 6:
      a = n / 7 * 2 + 1;
      b = n / 7 * 2 + 2;
      break;
  }
  printf("%d %d\n", a, b);
  return 0;
}
