2023-12-01 13:35:13 +01:00

30 lines
507 B
C

#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
int problems = 0;
while (1) {
int start;
scanf("%d", &start);
char c;
scanf("%c", &c);
if (c == '-') {
int end;
scanf("%d", &end);
problems += end - start + 1;
char x = getchar();
if (x == ';') continue;
else break;
} else if (c == ';') {
problems += 1;
continue;
} else {
problems += 1;
break;
}
}
printf("%d\n", problems);
}