#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  while (b != 0) {
    int t = b;
    b = a % b;
    a = t;
  }
  return a;
}
int sgn(int v) { return (v > 0) - (v < 0); }
int cmp_frac(int a, int b, int c, int d) { return sgn(a * d - b * c); }
int main() {
  int n;
  cin >> n;
  int ma = 1;
  int mb = 20000;
  for (int i = 1; i < n; ++i) {
    int a = i;
    int b = n - i;
    if (a > b) break;
    if (gcd(a, b) == 1) {
      if (cmp_frac(ma, mb, a, b)) {
        ma = a;
        mb = b;
      }
    }
  }
  cout << ma << " " << mb;
  return 0;
}
