#!/usr/bin/perl -w

use v5.16;

my %l = map { $_ => 1 } qw(2 3 4 7);
my $sum;
while (<>) {
	chomp;
	s/.*\| //;
	$sum += grep { $l{length()} } split /\s+/;
}

say $sum;





