#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (a == b) return a;
  if (a < b) swap(a, b);
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int ans_a = 1, ans_b = n - 1;
  for (int i = 1; i <= n / 2; i++) {
    if (gcd(n - i, i) == 1) {
      if (ans_a * (n - i) < i * ans_b) {
        ans_a = i;
        ans_b = n - i;
      }
    }
  }
  cout << ans_a << ' ' << ans_b << endl;
}
