/*
 * wordsworth.java
 *
 * Created on July 19, 2004, 9:07 PM
 */

import java.io.*;
import java.text.DecimalFormat;

/**
 *
 * @author  Numinor
 */
public class wordsworth
{
    
    /** Creates a new instance of wordsworth */
    public wordsworth()
    {
    }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws Exception
    {
        DecimalFormat cents = new DecimalFormat(".00");
        BufferedReader input = new BufferedReader(new FileReader("wordsworth.in"));
        
        int n = Integer.parseInt(input.readLine());
        String author;
        int payment;
        String quote;
        int value;
        
        for (int i = 0; i < n; i++)
        {
            author = input.readLine();
            payment = 0;
            quote = input.readLine();
            quote = quote.toLowerCase();
            for (int j = 0; j < quote.length(); j++)
            {
                value = (int)quote.charAt(j);
                if (97 <= value && value <= 122)
                {
                    payment += value - 96;
                }
            }
            
            System.out.print(author + ": ");
            System.out.print("$" + payment / 100 + cents.format( ((float)payment % 100) / 100 ));
            System.out.println();
        }
    }
    
}
