#!/usr/bin/perl -w

use v5.30;
use strict;

my ($two, $three);
while (<>) {
	chomp;
	my %h;
	$h{$_}++ for split //;
	$two++ if grep { $_ == 2 } values %h;
	$three++ if grep { $_ == 3 } values %h;
}

say $two * $three;


