#!/usr/local/bin/perl
use strict;

my ($buf, $size);
my $max = $ARGV[0] * 1024* 1024; 

$size = 0;
while(read STDIN, $buf, 32*1024) {
    print $buf;
    $size += length($buf);
    last if ($size >= $max);
}
