#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, a, b, x, y;
  cin >> n;
  for (i = 1; i <= n; i++) {
    a = i;
    b = n - i;
    if (a < b) {
      if (a == 1) {
        x = a;
        y = b;
      } else {
        for (j = 2; j <= a; j++) {
          if (a % j == 0 && b % j == 0) {
            break;
          } else {
            x = a;
            y = b;
          }
        }
      }
    } else {
      break;
    }
  }
  cout << x << " " << y;
  return 0;
}
