#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
int main() {
  int n, a, b;
  scanf("%d", &n);
  if (n % 2 == 0) {
    a = n / 2 - 1;
    b = n / 2 + 1;
  } else {
    a = n / 2;
    b = n - n / 2;
  }
  while (gcd(a, b) != 1) {
    a--;
    b++;
    if ((a == 0) || (b == n)) break;
  }
  printf("%d %d", a, b);
  return 0;
}
