#include <bits/stdc++.h>
using namespace std;
int primer[99999] = {1, 2, 3, 5};
int primerIdx = 4;
void calc() {
  for (int j = 6; j < 2000; j++) {
    bool f = true;
    for (int k = j - 1; k >= sqrt(j); k--) {
      if (j % k == 0) {
        f = false;
        break;
      }
    }
    if (f) {
      primer[primerIdx++] = j;
    }
  }
}
int a[9999], b[99999], c[99999], idx;
void calc2() {}
bool isPrimer(int a) {
  for (int j = 0; j < primerIdx; j++) {
    if (primer[j] == a) {
      return true;
    }
  }
  return false;
}
bool isPrimer(int x, int y) {
  for (int j = 2; j <= x; j++) {
    if (x % j == 0 && y % j == 0) {
      return false;
    }
  }
  return true;
}
int main() {
  calc();
  int total;
  while (cin >> total) {
    int low = ceil(total * 1. / 2);
    int up = total - low;
    while (up > 0) {
      if (isPrimer(up, low)) {
        cout << up << " " << low << endl;
        break;
      }
      low++;
      up--;
    }
  }
  return 0;
}
