#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int weeks = n / 7;
  int extraDays = n % 7;
  int holidays = weeks * 2;
  int maxHolidays = holidays + (extraDays > 1 ? 2 : extraDays);
  int minHolidays = holidays + (extraDays == 6 ? 1 : 0);
  cout << minHolidays << ' ' << maxHolidays << endl;
  return 0;
}
