#include <bits/stdc++.h>
using namespace std;
int main() {
  int x;
  cin >> x;
  int min, max;
  int a, b;
  a = x / 7;
  b = x % 7;
  if (b <= 2) {
    min = 0;
    max = b;
  } else if (b <= 5) {
    min = 0;
    max = 2;
  } else if (b == 6) {
    min = 1;
    max = 2;
  }
  min = min + a * 2;
  max = max + a * 2;
  cout << min << " " << max << endl;
}
