#!/usr/bin/perl -w

use v5.16;
use strict;

my $in = 33100000;

my $maxh = $in/10;

my @houses = (10) x $maxh;
for my $elf (2 .. $maxh) {
	my $h = $elf;
	do {
		$houses[$h] += 10*$elf;
		$h += $elf;
	} while ($h <= $maxh);
}

for my $h (1 .. $maxh) {
	next if $houses[$h] < $in;
	say $h;
	last;
}

