#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;
  if (n % 2 == 0) {
    int i = n / 2 - 1;
    int j = n / 2 + 1;
    while (GCD(i, j) != 1) {
      i--;
      j++;
    }
    cout << i << " " << j;
  } else {
    int i = n / 2;
    int j = n / 2 + 1;
    while (GCD(i, j) != 1) {
      i--;
      j++;
    }
    cout << i << " " << j;
  }
  return 0;
}
