#include <stdio.h> int main() {int x,y1,y2,y3; int count =0; scanf("%d %d %d %d",&x,&y1,&y2,&y3); while(x>(y1+y2+y3)) {x++;y1++;y2++;y3++;count++;} printf("%d",count); return 0;}
#include <stdio.h> int main() {int x,y1,y2,y3; int count =0; scanf("%d %d %d %d",&x,&y1,&y2,&y3); while(x>(y1+y2+y3)) {x++;y1++;y2++;y3++;count++;} printf("%d",count); return 0;}