#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
int main() {
  ll A, B;
  cin >> A >> B;
  ll N = 2 * A + 100 - B;
  if(N < 0) {
    N = 0;
  }
  cout << N;
}
#include<bits/stdc++.h>
using namespace std;

int main()
{
    int A,B;
    cin>>A>>B;

    int follow = 2 * A + 100;
    
    cout<<follow - B<<endl;
    return 0;
}