#!/usr/bin/perl

while ($l = <>) {
  chop($l) ;
  $l =~ s/\#.*$// ;
  if (!$l) {
    $start = 1 ;
    next ;
    }
  next if ($l =~ /^\s/) ;
  next if ($l =~ /^\+/) ;
  ($field,$val) = split(/\:\s+/,$l) ;
  if ($start) {
    ++$types{$field} ;
    $start = 0 ;
    }
  ++$used{$field} ;
  }

foreach $typ (sort keys %types) {
  print("$typ: $types{$typ}\n") ;
  }

print("\n") ;

foreach $typ (sort keys %used) {
  print("$typ: $used{$typ}\n") ;
  }

