#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
const int inf = 1e9 + 7;
int gcd(int x, int y) { return y ? gcd(y, x % y) : x; }
vector<pair<int, int> > v;
bool cmp(pair<int, int> x, pair<int, int> y) {
  return x.first * y.second > y.first * x.second;
}
int main() {
  cin.tie();
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  for (int a = 0; a <= n; ++a) {
    int b = n - a;
    if (a < b && gcd(a, b) == 1) v.push_back({a, b});
  }
  sort(v.begin(), v.end(), cmp);
  cout << v[0].first << " " << v[0].second;
}
