#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int Max = (n / 7) * 2;
  (n % 7) > 2 ? Max += 2 : Max += n % 7;
  int Min = (n / 7) * 2;
  (n % 7) > 5 ? Min += (n % 7) % 5 : Min += 0;
  cout << Min << " " << Max << endl;
  return 0;
}
