#include <bits/stdc++.h>
using namespace std;
int main() {
  int year, mod, Min, Max;
  cin >> year;
  mod = year % 7;
  Max = Min = (year / 7) * 2;
  if (mod > 5) Min += mod - 5;
  if (mod >= 2)
    Max += 2;
  else if (mod == 1)
    Max += 1;
  cout << Min << " " << Max;
  return 0;
}
