#include <iostream> using namespace std; int main (){ int a[501]; a[0]=1; int n,p; cin>>n>>p; for(int i=1;i<=n;i++) a[i]=a[i-1]+i; cout<<a[n]-p+2; }