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