#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int main() {
  int n;
  cin >> n;
  int b = n / 2 + 1;
  int ans1, ans2;
  for (int i = b, j = n - b; j >= 1, i <= n - 1; j--, i++) {
    if (gcd(i, j) == 1) {
      ans1 = j;
      ans2 = i;
      break;
    }
  }
  printf("%d %d\n", ans1, ans2);
  return 0;
}
