#include <bits/stdc++.h>
using namespace std;
int gcd(int x, int y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
int main() {
  int n;
  cin >> n;
  int ansx = 0, ansy = 0;
  for (int i = 1; i < n; i++) {
    int j = n - i;
    if (j <= i) break;
    if (gcd(i, j) != 1) continue;
    ansx = i;
    ansy = j;
  }
  cout << ansx << ' ' << ansy << endl;
  return 0;
}
