#!/usr/bin/perl
if( $ARGV[0] eq '-h' || $ARGV[0] eq '-help')
{
help();
exit;
}
sub help { 
    print "\nDrop off atoms whose mark is not larger than 'val'\n";
    print "Usage: pxyz_dropoff val  [file.pxyz] \n\n";
}

$bnk="   ";

$val=$ARGV[0];shift; #dropoff the atom if the mark value is no more than $val

$_=<>; # read in atom number
$_=<>; $buf=$buf.$_;

$natms=0;
while(<>)
{
($nam,$xxx,$yyy,$zzz,$mol,$mar)=split;
if ($mar > $val) {
$natms++;
$buf=$buf.$_;
}
}

print $natms."\n".$buf;




