#!perl -l $}=1;for(1..shift){$}*=$_;$}=~/([1-9]{1,4})0*$/;$}=$1}print chop$}
#!perl -l $}=1;for(1..shift){while(not$_%2){$_/=2;$i++}while(not$_%5){$_/=5;$i--}$}=($}*$_%10)%10}while($i){$}=($}*2)%10;$i--}print$}