#!/usr/bin/perl -w

use v5.16;
use strict;

my $sum;
while (<>) {
	chomp;
	next if ! /(..).*\1/;
	next if ! /(.).\1/;
	$sum++;
}
say $sum;
