#!/usr/bin/perl -w

use strict;

my $prev;
my $inc;
while (<>) {
	chomp;
	$inc++ if $prev && $_ > $prev;
	$prev = $_;
}

print $inc, "\n";

