#include using namespace std; int main() { int k,n,m; cin >> k >> n >> m; if (k==1) { cout << 0 << endl; } else if (k==2) { if (n==2 && m==2) { cout << -1 << endl; } else { if (n==1){ cout << 0 << endl; } else { cout << k-1 << endl; for(int i=1;i