int_data = input() sp_int = int_data.split(" ") first_sab = int(sp_int[0]) sec_sab = int(sp_int[1]) las_day = int(sp_int[2]) che_day = 1 result = 0 while(che_day <= las_day): if che_day != first_sab and che_day != sec_sab: result = result + 1 che_day = che_day + 1 print(result)