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