#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  while (b) {
    int rem = a % b;
    a = b;
    b = rem;
  }
  return a;
}
int main() {
  int n;
  cin >> n;
  int ansA = 1;
  int ansB = 1005;
  for (int a = 1; a <= n / 2; ++a) {
    int b = n - a;
    if (gcd(a, b) == 1 and 1.0 * a / b > 1.0 * ansA / ansB) {
      ansA = a;
      ansB = b;
    }
  }
  cout << ansA << ' ' << ansB;
}
