#include<bits/stdc++.h>
using namespace std;
int n , m ;
char question;
int s[500005] , d[500005] , a[500005];
long long lowbit(int x){
return x & -x;
}
void change(int x , int k){
while(x <= n){
s[x] += k ;
x += lowbit(x) ;
}
}
long long chazhao(int x){
int sum = 0 ;
while(x != 0){
sum += s[x] ;
x -= lowbit(x) ;
}
return sum ;
}
int main(){
cin >> n >> m ;
for(int i = 1 , x , a , b ; i <= m ; i ++){
cin >> question ;
cin >> a >> b ;
if(question == 'x'){
d[a] += b;
change(a , b) ;
}else{
cout << chazhao(b) - chazhao(a - 1) << endl ;
}
}
}