#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  scanf("%d", &n);
  int a, b;
  a = n / 2;
  b = n - a;
  if (a == b) {
    a--;
    b++;
  }
  vector<int> elem;
  int ans_A = 1, ans_B = n - 1;
  for (int a = 2; a <= n / 2; a++) {
    bool coprime = true;
    b = n - a;
    for (int i = 2; i <= a; i++) {
      if ((a % i == 0) && (b % i == 0)) {
        coprime = false;
      }
    }
    if (coprime && a > ans_A && b < ans_B) {
      ans_A = a;
      ans_B = b;
    }
  }
  printf("%d %d", ans_A, ans_B);
}
