#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int main() {
  int n;
  scanf("%d", &n);
  int m = n >> 1;
  int a, b;
  for (int i = m; i >= 1; i--) {
    int j = n - i;
    if (i >= j) continue;
    if (gcd(i, j) == 1) {
      a = i;
      b = j;
      break;
    }
  }
  printf("%d %d\n", a, b);
  return 0;
}
