#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int mod = n % 7;
  int weeks = n / 7;
  switch (mod) {
    case 0:
      cout << 2 * weeks << " " << 2 * weeks << endl;
      break;
    case 1:
      cout << 2 * weeks << " " << 2 * weeks + 1 << endl;
      break;
    case 2:
      cout << 2 * weeks << " " << 2 * weeks + 2 << endl;
      break;
    case 3:
      cout << 2 * weeks << " " << 2 * weeks + 2 << endl;
      break;
    case 4:
      cout << 2 * weeks << " " << 2 * weeks + 2 << endl;
      break;
    case 5:
      cout << 2 * weeks << " " << 2 * weeks + 2 << endl;
      break;
    case 6:
      cout << 2 * weeks + 1 << " " << 2 * weeks + 2 << endl;
  }
  return 0;
}
