#include<bits/stdc++.h>
#define int long long
#define endl "\n"
#define ll p<<1
#define rr p<<1|1
using namespace std;
const int N=100005;
int m,n,w[N],x,y;
char c;
struct stu{
int l,r,sum;
}tr[4*N];
void pushup(int p){
tr[p].sum+=tr[ll].sum+tr[rr].sum;
return ;
}
void build(int p,int l,int r){
tr[p].l=l;
tr[p].r=r;
if(l==r) return ;
int mid=(l+r)>>1;
build(ll,l,mid);
build(rr,mid+1,r);
pushup(p);
}
void change(int p,int x,int k){
if(tr[p].l==x&&tr[p].r==x){
tr[p].sum+=k;
return ;
}
int mid=(tr[p].l+tr[p].r)>>1;
if(x<=mid) change(ll,x,k);
else change(rr,x,k);
pushup(p);
}
int find(int p,int x,int y){
if(tr[p].l>=x&&tr[p].r<=y){
return tr[p].sum;
}
int mid=(tr[p].l+tr[p].r)>>1,num=0;
if(x<=mid) num+=find(ll,x,y);
if(y>mid) num+=find(rr,x,y);
return num;
}
signed main(){
cin>>n>>m;
build(1,1,n);
for(int i=1;i<=m;i++){
cin>>c>>x>>y;
if(c=='x'){
change(1,x,y);
}else{
cout<<find(1,x,y)<<endl;
}
}
return 0;
}