/* Freehold High School

 * Nooruddin Hashmi

 * School Code: 2100

 * Advisor: Mr. James Gill

 * Intermediate 5

 * ACSL Prints

 * Gives the Primary Group Ratio using either

 * the Henry System or the AFCS.

 */

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

 

namespace ACSL

{

    class Prints

    {

                    private static int[] henry = {

                                    16, 16, 8, 8, 4, 4, 2, 2, 1, 1

                    };

 

        private static int[] automated = {

                                    16, 8, 4, 2, 1, 16, 8, 4, 2, 1

                    };

 

        static void Main(string[] args)

        {

                                    string[] inp;

                                    byte fingerNum;

                                    bool isHenry;

                                    for (int i = 0, num = 1, den = 1; i < 5; i++, num = 1, den = 1)

            {

                Console.Write(i + 1 + ". ");

                                                    inp = Console.ReadLine().Replace(" ", "").ToUpper().Split(',');

                                                    isHenry = (inp[0] == "H");

                                                    for (int j = 1; j < inp.Length; j++)

                {

                                                                    fingerNum = byte.Parse(inp[j]);

                                                                    if (fingerNum == 0)

                                                                                    break;

                    if (isHenry)

                        if (fingerNum % 2 == 0)

                            num += henry[fingerNum - 1];

                        else

                            den += henry[fingerNum - 1];

                    else

                        if (fingerNum < 6)

                            num += automated[fingerNum - 1];

                        else

                            den += automated[fingerNum - 1];

                                                    }

                                                    Console.WriteLine(i + 1 + ". " + num + "/" + den);

                                    }

        }

    }

}