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