#include <bits/stdc++.h>
using namespace std;
bool isPrime(int n) {
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0) return false;
  }
  return true;
}
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  int n;
  cin >> n;
  int l = n;
  if (n % 2)
    l = l / 2;
  else
    l = l / 2 - 1;
  for (int i = l; i >= 1; i--) {
    int p = n - i;
    if (gcd(i, p) == 1) {
      cout << i << " " << p;
      break;
    }
  }
}
