#include <bits/stdc++.h>
using namespace std;
int gcd(int x, int y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
int N, a, b, mx;
int main() {
  scanf("%d", &N);
  for (int i = 1; i <= N; i++) {
    if (i >= N - i || gcd(i, N - i) != 1) continue;
    mx = max(mx, i);
  }
  printf("%d %d", mx, N - mx);
  return 0;
}
