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