#include <stdio.h>
#include <string.h>
#define maxn 100
int main()
{
char s[maxn];
int i,j,v=0;
memset(s, '0', sizeof(s));
while(~scanf("%s", s))
{
double sum = 0.0;
for( i = 0; i < strlen(s); i++)
{
v=0;
switch(s[i])///在里面继续判断 如C10H10 C2H4
{
case 'C':
{
if(s[i+1] > '0' && s[i+1] <= '9')
{
for(j=i+1; j<strlen(s); j++)
{
if(s[j]>='0'&&s[j]<='9')
v=10*v+(s[j]-48);
else
break;
}
sum += v* 12.01;
}
else
sum += 12.01;
break;
}
case 'H':
{
if(s[i+1] > '0' && s[i+1] <= '9')
{
for(j=i+1; j<strlen(s); j++)
{
if(s[j]>='0'&&s[j]<='9')
v=10*v+(s[j]-48);
else
break;
}
sum += v* 1.008;
}
else
sum += 1.008;
break;
}
case 'O':
{
if(s[i+1] > '0' && s[i+1] <= '9')
{
for(j=i+1; j<strlen(s); j++)
{
if(s[j]>='0'&&s[j]<='9')
v=10*v+(s[j]-48);
else
break;
}
sum += v* 16.00;
}
else
sum += 16.00;
break;
}
case 'N':
{
if(s[i+1] > '0' && s[i+1] <= '9')
{
for(j=i+1; j<strlen(s); j++)
{
if(s[j]>='0'&&s[j]<='9')
v=10*v+(s[j]-48);
else
break;
}
sum += v* 14.01;
}
else
sum += 14.01;
break;
}
default:
break;
}
}
printf("%.3fg/mol\n", sum);
}
return 0;
}