#include <bits/stdc++.h>
using namespace std;
const int N = 3e6 + 7;
long long int a[N], b[N], c[N], tree[N], lazy[N], cnt, sum, s2, mx;
vector<long long int> v, u;
vector<pair<long long int, long long int>> vp;
map<long long int, long long int> mp;
bool vis[111111];
pair<long long int, long long int> p;
set<pair<long long int, long long int>> ss;
queue<long long int> q;
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, m = 0, d, i = 0, s1 = 0, s2 = 0, q = 5, x = 0, y, k, j;
  string s;
  cin >> n;
  if (n % 2 == 0)
    m = n / 2 - 1;
  else
    m = n / 2;
  double mx = 0.0;
  for (i = m; i > 0; i--) {
    map<long long int, long long int> mm;
    cnt = 0;
    for (j = 2; j <= i; j++) {
      if (i % j == 0) mm[j]++;
    }
    for (j = 2; j <= (n - i); j++) {
      if ((n - i) % j == 0 && mm[j] != 0) {
        cnt = 1;
        break;
      }
    }
    if (cnt == 0) return cout << i << " " << n - i, 0;
  }
}
