Traverse through array elements and Count frequencies of all primes
for ( int i = 0 ; i < n ; i ++ ) { if ( prime [ arr [ i ] ] ) if ( mp . ContainsKey ( arr [ i ] ) ) mp [ arr [ i ] ] ++ ; else mp . Add ( arr [ i ] , 1 ) ; }