#include using namespace std; using ll = long long; template istream& operator >> (istream& is, vector& vec) { for(T& x : vec) is >> x; return is; } int main(){ ios::sync_with_stdio(false); cin.tie(0); int n, x; cin >> n >> x; vector a(n); cin >> a; cout << max(0, accumulate(a.begin(), a.end(), 0) - x) << '\n'; }