#!/usr/bin/perl

use v5.30;
use strict;

chomp (my $stream = <>);

my $glen;
1 while $stream =~ s/<([^!>]*)!./<$1/;
1 while $stream =~ s/<([^>]*?)>/$glen += length $1/e;
say $glen;

