#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  ;
  int minim = n / 7 * 2;
  int x = n % 7;
  if (x == 6) minim++;
  int maxim = 0;
  maxim += n / 7 * 2;
  int y = n % 7;
  if (y != 0) maxim += min(y, 2);
  cout << minim << " " << maxim << endl;
}
