#include <stdio.h>

int main() {
    int n , t, a;
    while (scanf ("%d %d %d\n",&n, &t, &a) != EOF) {
      if (t >= a) {
        printf ("%d\n", a + n -t);
      } else {
        printf ("%d\n", t + n -a);
      }
    }
    
    return 0;
}