#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const double EPS = 1e-8;
const int MOD = 1000000007;
const int SIZE = 0;
void Init(void) { return; }
inline int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
void Solve(void) {
  int n;
  scanf("%d", &n);
  if (n % 2 == 1)
    printf("%d %d", n / 2, n / 2 + 1);
  else {
    for (int i = n / 2; i >= 1; --i)
      if (gcd(n - i, i) == 1) {
        printf("%d %d", i, n - i);
        return;
      }
  }
  return;
}
int main(void) {
  Init();
  Solve();
  return 0;
}
