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