#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int main() {
  int n;
  cin >> n;
  int ans_a, ans_b;
  for (int a = 1; a <= n / 2; ++a) {
    int b = n - a;
    if (a == b) continue;
    if (gcd(a, b) == 1) ans_a = a, ans_b = b;
  }
  cout << ans_a << ' ' << ans_b;
  return 0;
}
