#!/usr/bin/perl -w

use strict;

chomp (my @a = <>);
my $prev;
my $inc;

for my $i (0 .. $#a-2) {
	my $sum = $a[$i]+$a[$i+1]+$a[$i+2];
	$inc++ if $prev && $sum > $prev;
	$prev = $sum;
}

print "$inc\n";
