#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long mx = 1e5 + 5;
long long middle(long long a, long long b, long long c) {
  if ((a <= b && b <= c) || (c <= b && b <= a))
    return b;
  else if ((b <= a && a <= c) || (c <= a && a <= b))
    return a;
  else
    return c;
}
bool ispalindrom(string s) {
  transform(s.begin(), s.end(), s.begin(), ::tolower);
  return (s[0] == s[s.size() - 1] ? 1 : 0);
}
bool as_second(const pair<long long, long long> &a,
               const pair<long long, long long> &b) {
  return (a.second < b.second);
}
bool ds_first(const pair<long long, long long> &a,
              const pair<long long, long long> &b) {
  return (a.first > b.first);
}
bool ds_second(const pair<long long, long long> &a,
               const pair<long long, long long> &b) {
  return a.second > b.second;
}
template <typename KeyType, typename ValueType>
std::pair<KeyType, ValueType> get_max(const std::map<KeyType, ValueType> &x) {
  using pairtype = std::pair<KeyType, ValueType>;
  return *std::max_element(x.begin(), x.end(),
                           [](const pairtype &p1, const pairtype &p2) {
                             return p1.second < p2.second;
                           });
}
static inline bool isvowel(char ch) {
  static const std::string vowels("aeiouEAIOU");
  return vowels.end() != std::find(vowels.begin(), vowels.end(), ch);
}
template <typename Map>
bool map_compare(Map const &lhs, Map const &rhs) {
  return lhs.size() == rhs.size() &&
         std::equal(lhs.begin(), lhs.end(), rhs.begin());
}
long long nCr(long long n, long long k) {
  long long ans = 1;
  k = k > n - k ? n - k : k;
  long long j = 1;
  for (; j <= k; j++, n--) {
    if (n % j == 0) {
      ans *= n / j;
    } else if (ans % j == 0) {
      ans = ans / j * n;
    } else {
      ans = (ans * n) / j;
    }
  }
  return ans;
}
string str, str1, str2, str3, str4, str5, str6, str7;
char ch, ch1, ch2, ch3;
bool flag = true, flag1 = true, flag2 = true;
long long a, b, c, d, e, f, g, h, l, i, j, k, m, n, o, p, q, r, s, t, u, v, w,
    x, y, z, a1, b1, a2, b2, a3, b3, a4, b4, a5, b5,
    f1 = 0, f2 = 0, cnt = 0, cnt1 = 0, cnt2 = 0, cnt3 = 0, cnt4 = 0, sum = 0,
    sum1 = 0, sum2 = 0, sum3 = 0, ma = 0, ma1 = 0, mi = INT_MAX, mi1 = INT_MAX,
    temp = 0, temp1 = 0, temp2 = 0;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  if (n & 1) {
    cout << n / 2 << " " << n - (n / 2) << endl;
  } else {
    if (((n / 2) - 1) % 2 == 0 and ((n / 2) + 1) % 2 == 0) {
      cout << (n / 2) - 2 << " " << (n / 2) + 2 << endl;
    } else
      cout << (n / 2) - 1 << " " << (n / 2) + 1 << endl;
  }
  return 0;
}
