#!/usr/bin/perl -w

use v5.16;

my $sum;
while (<>) {
	chomp;
	s/.*\| //;
	$sum += grep { my $x = length; $x == 2 || $x == 3 || $x == 4 || $x == 7; } split /\s+/;
}

say $sum;





