#!/usr/bin/perl

foreach (0..7) {
$summa += (substr($ARGV[0],$_,1) * (3,2,7,6,5,4,3,2)[$_]);
}

print 11 - ($summa % 11);