#include<stdio.h>
#include<math.h>

int main(){
    
    int ary[100],fail,pass,i,j,n;
    int highest_1,highest_2,highest_3;

    printf("Enter total Number of Student: ");
    scanf("%d", &n);

    for ( i = 0; i < n; i++)
    {
        printf("Enter Obtained Marks: ");
        scanf("%d", &ary[i]);
    }

    highest_1 = 0;
    highest_2 = 0;
    highest_3 = 0;

    for ( i = 0; i < n; i++)
    {
        if ( ary[i] > highest_1)
        {
            highest_1=ary[i];
        }
        
    }

    for ( i = 0; i < n; i++)
    {
        if ( ary[i] == highest_1 )
            continue;
        if ( ary[i] > highest_2)
        {
            highest_2=ary[i];
        }
    }

    for ( i = 0; i < n; i++)
    {
        if ( ary[i] == highest_1 )
            continue;
        if ( ary[i] == highest_2 )
            continue;
        if ( ary[i] > highest_3)
        {
            highest_3=ary[i];
        }
    }

    fail=0;
    for ( i = 0; i < n; i++)
    {
        if ( ary[i] < 40)
        {
            fail=fail+1;
        }
        
    }
    
    pass=(n-fail);
    

    printf("H1=%d\n",highest_1);
    printf("H2=%d\n",highest_2);
    printf("H3=%d\n",highest_3);
    printf("Fail=%d\n",fail);
    printf("Pass=%d\n",pass);
    
    

}