#!/share/bin/perl
open(IN, $ARGV[0]);

my $length=0;
my $chrom="";
while($line=<IN>)
{
  chomp($line);
  if ($line=~/>(.*)/)
  {
     if ($length>0)
     {
       print $chrom."\t".$length."\n";
     }
     $chrom=$1;
     $length=0;
  }
  else
  {
     $length+=length($line);
  }
}
print $chrom."\t".$length."\n";
