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