#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,w,tree[1000010];
ll lowbit(ll x){
return x&-x;
}
ll sum(ll x){
int ans=0;
while(x>=1){
ans+=tree[x];
x-=lowbit(x);
}
return ans;
}
void add(ll x,ll k){
while(x<=n){
tree[x]+=k;
x+=lowbit(x);
}
}
int main(){
cin>>n>>w;
for(int i=1;i<=w;i++){
char cnt;
int a,b;
cin>>cnt>>a>>b;
if(cnt=='x'){
add(a,b);
}else{
cout<<sum(b)-sum(a-1)<<endl;
}
}
return 0;
}