#!/usr/bin/perl -w

use v5.16;

my $count;
NUM:
for (347312..805915) {
	for my $d (0 .. 9) {
		goto FOUND if /$d{2}/ && !/$d{3}/;
	}
	next;
	FOUND:
	my $prev = 0;
	for my $d (split //) {
		next NUM if $d < $prev;
		$prev = $d;
	}
	$count++;
}

say $count;

