#include <bits/stdc++.h>
using namespace std;
bool gcd(int a, int b) {
  do {
    int r = a % b;
    a = b;
    b = r;
  } while (b);
  return a == 1;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, x, y;
  cin >> n;
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++) {
      if (gcd(i, j) && i + j == n) {
        x = i;
        y = j;
      }
    }
  cout << x << " " << y;
}
