#include <iostream>
#include <sstream>
using namespace std;

int main() {
    string input;
    while (getline(cin, input)) { // 读取整行输入
        long long a, b, c; // 使用 long long 类型存储数字
        // 使用 stringstream 解析输入字符串
        stringstream ss(input);

        // 提取第一个数字 a
        ss >> a;
        // 跳过第一个逗号
        ss.ignore();
        // 提取第二个数字 b
        ss >> b;
        // 跳过省略号和第二个逗号
        ss.ignore(5); // 跳过 ",..."
        // 提取第三个数字 c
        ss >> c;

        // 计算省略的数字数量
        long long omitted = c - b - 1;
        cout << omitted << endl;
    }
    return 0;
}