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