#include <iostream>
using namespace std;
class WaterMellon
{
public:
WaterMellon(double w)
{
weight = w;
total++;
totalWeight += w;
}
void set(double w){ weight = w; }
~WaterMellon()
{
total--;
totalWeight -= weight;
}
double weight;
static double totalWeight;
static double total;
};
double WaterMellon::total = 0;
double WaterMellon::totalWeight = 0;
int main()
{
int n, m;
WaterMellon *watermellon[100];
cin >> n;
int count = 1;
while (n != -1)
{
cin >> m;
if (n == 1)
{
watermellon[count]->set(m);
count++;
}
if (n == 0)
{
watermellon[m]->~WaterMellon;
}
cin >> n;
}
cout << watermellon[1]->totalWeight;
cout << watermellon[1]->total;
}
using namespace std;
class WaterMellon
{
public:
WaterMellon(double w)
{
weight = w;
total++;
totalWeight += w;
}
void set(double w){ weight = w; }
~WaterMellon()
{
total--;
totalWeight -= weight;
}
double weight;
static double totalWeight;
static double total;
};
double WaterMellon::total = 0;
double WaterMellon::totalWeight = 0;
int main()
{
int n, m;
WaterMellon *watermellon[100];
cin >> n;
int count = 1;
while (n != -1)
{
cin >> m;
if (n == 1)
{
watermellon[count]->set(m);
count++;
}
if (n == 0)
{
watermellon[m]->~WaterMellon;
}
cin >> n;
}
cout << watermellon[1]->totalWeight;
cout << watermellon[1]->total;
}