#include <bits/stdc++.h>
using namespace std;
int gcd(int x, int y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
bool coprime(int a, int b) {
  int Gcd = gcd(a, b);
  if (Gcd == 1)
    return 1;
  else
    return 0;
}
int main() {
  int n;
  cin >> n;
  int a1 = 0, b1 = 0;
  int a = 1, b = n - 1;
  float max1 = 0;
  while (a < b) {
    if (coprime(a, b)) {
      if ((1.0 * a) / b > max1) {
        max1 = (1.0 * a) / b;
        a1 = a;
        b1 = b;
      }
    }
    a++;
    b--;
  }
  cout << a1 << " " << b1;
  return 0;
}
