#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9;
const int mod = inf + 7;
const double eps = 1e-9;
const double pi = acos(-1.0);
const int days[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
vector<int> g[100100];
bool gcd(int a, int b) {
  for (int i = 2; i <= min(a, b); ++i) {
    if (a % i == 0 && b % i == 0) {
      return false;
    }
  }
  return true;
}
int main() {
  int n, m;
  cin >> n;
  int res = 0, res2 = 0;
  int j = n - 1;
  for (int i = 1; i <= n / 2; ++i) {
    if ((i + j) == n && gcd(i, j)) {
      res = i;
      res2 = j;
    }
    j--;
  }
  cout << res << " " << res2 << endl;
  return 0;
}
