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