#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (a == 0)
    return b;
  else if (b == 0)
    return a;
  else if (a >= b)
    return gcd(b, a % b);
  else
    return gcd(a, b % a);
}
int main() {
  int n;
  cin >> n;
  int numerator, denominator;
  denominator = n / 2 + 1;
  numerator = n - denominator;
  while (gcd(numerator, denominator) > 1 && numerator > 1) {
    numerator--;
    denominator++;
  }
  cout << numerator << " " << denominator;
  return 0;
}
