#!/usr/bin/env perl

my %distribution = ();
my $prev;

while (<>) {
	if (/([0-9a-fA-F]+):/) {
		my $delta = hex ($1) - $prev;
		if ($delta != 0) {
			$distribution{$delta}++;
			$prev = hex ($1);
		}
	} elsif (/([0-9a-fA-F]+) \<([^>]*)\>:/) {
		$prev = hex ($1);
		#print $2 . "\n"; 
	}
}

my $length;
my $total = 0;
my $bigger_than_5 = 0;
for $length (keys %distribution) {
	print "length: " . $length . " n: " . $distribution{$length} . "\n";
	$total += $distribution{$length};
	if ($length >= 5) {
		$bigger_than_5 += $distribution{$length};
	}
}
print "total: " . $total . "\n";
print ">=5: " . $bigger_than_5/$total*100 . "%\n";
