#include <bits/stdc++.h>
using namespace std;
inline bool EQ(double a, double b) { return fabs(a - b) < 1e-9; }
const int INF = (((1 << 30) - 1) << 1) + 1;
const int nINF = 1 << 31;
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  double ans = 0;
  pair<int, int> res;
  for (int i = (n - 2); i >= (0); i--) {
    int a = i, b = n - i;
    if (a > b) continue;
    if (gcd(a, b) == 1 && a / (double)b > ans) {
      ans = a / (double)b;
      res = {a, b};
    }
  }
  cout << res.first << ' ' << res.second << endl;
  return 0;
}
