#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a = max(1, n / 2);
  int b = n - a;
  if (a == b) {
    a--;
    b++;
  }
  if (a % 2 == 0 && b % 2 == 0) {
    a--;
    b++;
  }
  cout << a << " " << b;
  return 0;
}
