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