#include using namespace std; int main(){ int i,j,k,l; int m,n; int h,x,y; cin>>n; l=0; for (i=0;i>j; l+=j; } cin>>j; cout<<(l-j)<