#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int n1 = n / 7, n2 = n % 7;
  int s1, s2;
  if (n2 == 0)
    s1 = 0;
  else if (n2 == 1)
    s1 = 1;
  else
    s1 = 2;
  if (n2 <= 5)
    s2 = 0;
  else
    s2 = 1;
  cout << n1 * 2 + s2 << " " << n1 * 2 + s1;
}
