#!/usr/bin/perl -w

$count = 0;

while ($string = <>) {
	while ($string =~ /\"[^\"]*\"[,\n]/g) {
		$count++;
	}
	$count--;
	print $count, "\n";
}
