#!/usr/local/bin/perl 

my $top_n = shift;

my $top_n_sum = 0;
my $total_sum = 0;
my $count = 0;

while (defined($line = <STDIN>)) {
  chomp($line);
  $line =~ s/\D//g;
  $total_sum += $line;
  if ($count < $top_n) {
    $top_n_sum += $line;
  }
  $count++;
}

print sprintf("%d/%d (%.1f%%)\n",
	      $top_n_sum,
	      $total_sum,
	      100*$top_n_sum/$total_sum
	     );
