#include <stdio.h> #include <string.h> int main() { char s[21]; scanf("%s",s); int count = 0; long long int num_1 = 0; long long int num_2 = 0; for(int i = 0;i<strlen(s);i++) { if(s[i] == ',') break; num_1 = (s[i] - '0')+num_1 * 10; } for(int j = 0;j<strlen(s);j++) { if(s[j]==',') count ++; if (count == 3) { count ++; continue; } if (count == 4 ) { num_2 = (s[j] - '0') + num_2 * 10; } } printf("%lld",num_2-num_1-2); return 0; }