#include <iostream>
using namespace std;

int main() {
    int a;
    cin >> a;
    string str;
    getline(cin, str);
    int i = str.size() - 1;
    string c = "";
    while(isdigit(str[i])) c = str[i--] + c;
    
    cout << stol(c) - a - 2 << endl;

    return 0;

}
// 64 位输出请用 printf("%lld")