#!perl use warnings; use strict; use utf8; my $total =<>; my $last_cod =<>; printf "%d\n", 8**($total/3 -1)*$last_cod;