#include <bits/stdc++.h>
using namespace std;
int n;
int gcd(int x, int y) { return y == 0 ? x : gcd(y, x % y); }
int main() {
  cin >> n;
  for (int i = n; i >= 1; i--)
    if (i < n - i && gcd(i, n - i) == 1) {
      cout << i << ' ' << n - i << endl;
      return 0;
    }
  return 0;
}
