#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (a == 0 || b == 0) return a + b;
  return gcd(b % a, a);
}
int main() {
  int n;
  cin >> n;
  int curr = n / 2;
  int a = curr;
  int b = n - curr;
  while (gcd(a, b) != 1) {
    a--;
    b++;
  }
  cout << a << " " << b << endl;
}
