#include <bits/stdc++.h>
int gcd(int a, int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int main() {
  int n;
  scanf("%d", &n);
  int a = 0, b = n, to;
  for (int i = 1; i <= n / 2; ++i) {
    int check = gcd(i, n - i);
    if (check == 1 && i < n - i) {
      a = i;
      b = n - i;
    }
  }
  printf("%d %d\n", a, b);
  return 0;
}
