#include <iostream>
#include <string>
#include <vector>
#include <iomanip>
#include <cmath>
#include <set>
#include <queue>
#include <cstdio>
#include <algorithm>
#include <map>
using namespace std;
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
#define null NULL
typedef long long ll;
const int N = 100010;
struct Node;
typedef Node* pNode;
struct Node {
long long key, prior;
long long w = 1;
pNode l = NULL, r = NULL;
Node(){}
Node(long long _key): key(_key) {
prior = rand();
}
Node(ll _key, ll _prior): key(_key), prior(_prior) {}
};
Node init[N];
ll cnt = 0;
inline pNode newNode(ll key) {
init[cnt].key = key;
init[cnt].prior = rand();
return &init[cnt++];
}
pNode root = NULL;
long long W(pNode p) {
return !p ? 0 : p->w;
}
void split(pNode T, pNode& L, pNode& R, ll x) {
if(!T) {
L = NULL, R = NULL;
return;
}
if(T->key < x) {
split(T->r, T->r, R, x);
L = T;
} else {
split(T->l, L, T->l, x);
R = T;
}
if(L) L->w = 1 + W(L->l) + W(L->r);
if(R) R->w = 1 + W(R->l) + W(R->r);
}
void merge(pNode &T, pNode L, pNode R) {
if(!L || !R) {
T = L ? L : R;
if(T) T->w = L ? L->w : R->w;
return;
}
if(L->prior > R->prior) {
merge(L->r, L->r, R);
T = L;
} else {
merge(R->l, L, R->l);
T = R;
}
if(T) {
T->w = 1;
if(L) T->w += L->w;
if(R) T->w += R->w;
}
}
void insert(pNode& T, pNode x) {
if(!T) {
T = x;
return;
}
if(T->prior > x->prior) {
insert(x->key < T->key ? T->l : T->r, x);
} else {
split(T, x->l, x->r, x->key);
T = x;
}
T->w = 1;
if(T->l) T->w += W(T->l);
if(T->r) T->w += W(T->r);
}
inline long long count(pNode p, ll x) {
if(!p) return 0;
if(p->key < x) return count(p->r, x);
else return W(p->r) + 1 + count(p->l, x);
}
inline void erase(pNode& p, ll x) {
if(p->key == x) {
merge(p, p->l, p->r);
} else {
erase(x < p->key ? p->l : p->r, x);
}
}
int main() {
ios_base::sync_with_stdio(false);
// cout <<fixed <<setprecision(15);
srand(134254);
// freopen("in.txt", "r", stdin);
// cout <<getOldNom(2) <<endl;
// return 0;
long long ans = 0;
for(;;) {
string type;
cin >>type;
if(type == "BID") {
double dprice;
cin >>dprice;
ll price((dprice+1e-9) * 100);
insert(root, newNode(price));
} else if(type == "DEL") {
double dprice;
cin >>dprice;
ll price((dprice+1e-9) * 100);
erase(root, price);
} else if(type == "SALE") {
long long k;
double dprice;
cin >>dprice;
ll price((dprice+1e-9) * 100);
cin >>k;
ll cansale = count(root, price);
// cout <<"can sale: " <<cansale <<endl;
ans += min(cansale, k);
} else {
break;
}
}
cout <<fixed <<setprecision(2) <<ans * 0.01 <<endl;
return 0;
}