#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int N;
  cin >> N;
  for (int n = N / 2; n >= 1; n--) {
    int d = N - n;
    if (n < d && gcd(n, d) == 1) {
      cout << n << " " << d;
      break;
    }
  }
}
