#!/usr/bin/perl -w

use v5.36;
use strict;
use experimental 'multidimensional';

chomp($_ = <>);
my $i;
s/^.//, $i++ while substr($_, 0, 4) =~ /(.).*\1/;
say $i + 4;

