#!/usr/bin/perl -w

use strict;
use Data::Dumper;

local $/;
my @ads = sort { $a <=> $b } map { chomp; $_ } split /\n/, <>;

my $prev = 0;
my $ones = 0;
my $total = 1;
my @ones2count = qw(1 1 2 4 7);
push @ads, $ads[-1]+3;
for my $n (@ads) {
	if ($n - $prev == 1) {
		$ones++;
	} else {
		print "$ones ones + 3, total=$total*$ones2count[$ones]\n";
		$total *= $ones2count[$ones];
		$ones = 0;
	}
	$prev = $n;
}

print "total=$total\n";

