#include <stdio.h>
#include <stdlib.h>
int main(void){
double num1, num2;
double max, min;
int k=0;
scanf("%lf %lf", &num1, &num2);
if (num1>num2){
max = num1;
min= num2;
}
else
{
min = num1;
max= num2;
}
k = int(max)-int(min);
//if (int(max)==max || int(min)==min) k=k-1;
if (int(max)==max ) k=k-1;
printf("%d", k);
system("pause");
return 0;
}