#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
const int INF = 0x3f3f3f3f;
const long long LL_INf = 0x3f3f3f3f3f3f3f3f;
const long long mod = 1000000009;
const int N = 1e5 + 10;
int gcd(int a, int b) {
  if (!b)
    return a;
  else
    return gcd(b, a % b);
}
int n, a, b;
int main() {
  cin >> n;
  for (int i = (n - 1); i >= (1); i--) {
    a = i;
    b = n - a;
    if (a >= b) continue;
    if (gcd(a, b) == 1) {
      cout << a << ' ' << b << endl;
      return 0;
    }
  }
  return 0;
  return 0;
}
