#include <bits/stdc++.h>
using namespace std;
int n;
int gcd(int first, int second) {
  if (second == 0) return first;
  return gcd(second, first % second);
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = n - 1; ~i; --i)
    if (gcd(i, n - i) == 1 && i < n - i)
      return cout << min(i, n - i) << " " << max(i, n - i) << endl, 0;
  return 0;
}
