#include #include using namespace std; int main() { int n, s, t; while(scanf("%d%d%d", &n, &s, &t) != EOF) { if (s > t) s = n - s + 1, t = n - t + 1; if(s == 1 && t == n)printf("0\n");else if(s == t)printf("-1\n");else if(s == 1 || abs(s - t ) == 1)printf("1\n");else printf("2\n"); } return 0; }