#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  double ans = 0;
  int x, y;
  for (int i = 1; i <= n - 1; i++) {
    int a = i;
    int b = n - i;
    if (b > a) {
      int cnt[1005] = {0};
      for (int j = 2; j <= min(a, b); j++) {
        if (a % j == 0) {
          cnt[j]++;
        }
        if (b % j == 0) {
          cnt[j]++;
        }
      }
      double res = (double)a / b;
      bool flag = true;
      for (int j = 2; j <= min(a, b); j++) {
        if (cnt[j] > 1) {
          flag = false;
          break;
        }
      }
      if (flag == true && res > ans) {
        ans = res;
        x = a, y = b;
      }
    }
  }
  cout << x << " " << y;
}
