function Main(input){
  input = input.split('');
  var x =Number(input[0]+input[1]);
  var y =Number(input[3]+input[4]);
  var ans = (x-y)+1;
  console.log(ans);
}

Main(require("fs").readFileSync("/dev/stdin","utf8"));