#!/usr/bin/perl -w

use v5.16;

my $sum;
$sum += int($_/3)-2 for <>;
say $sum;
