#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, num = 0, dem = 0;
  cin >> n;
  if (n % 2 == 0) {
    num = (n / 2) - 1;
    dem = (n / 2) + 1;
  } else {
    num = n / 2;
    dem = n - num;
  }
  set<int> x, y;
  while (1) {
    int flag1 = -1;
    x.clear();
    y.clear();
    if (num == 2) x.insert(num);
    for (int i = 2; i * i <= num; i++) {
      if (num % i == 0) {
        x.insert(i);
        x.insert(num / i);
      }
    }
    for (int i = 2; i * i <= dem; i++) {
      if (dem % i == 0) {
        y.insert(i);
        y.insert(dem / i);
      }
    }
    for (auto i : x) {
      if (y.count(i) == 1) {
        flag1 = 1;
        break;
      }
    }
    if (flag1 == -1) break;
    num--;
    dem++;
  }
  return cout << num << " " << dem << "\n", 0;
}
