#!perl

#Analysis of string frequencies

my $data = join("", <>);

my @populations = ($data =~ /(.+?)Best/gs);

my @countDiffStrings;
for ( @populations ) {
  my @strings = /(\w+) -> /g;
  my %diffStrings;
  map ( $diffStrings{$_}=1, @strings );
  push @countDiffStrings, scalar (keys %diffStrings);
}

print join("\n", @countDiffStrings );
