Summing subform

Summing subform

Hi, I have a subform where I add contacts and it sums the number of them i add in the subform, with the next formula

    temptotalB = 0;
        for each record in contactos1
        {
            record.Sub_Total = record.contagem2;
            temptotalB = (temptotalB  +  record.Sub_Total);
        }
        input.total3 = temptotalB;

the columns of the subform are 

contagem2 Tipo de Contacto Data de Contacto Observações: Sub_Total

How can i do this for one condition, for example if a contact doesn´t answer I put in the "Tipo de Contacto" where it´s a dropbox decision, "Não atendeu", and then I want to calculate how much "Não atendeu" there are in that form that has the totals??? Thanks