Deary me, must remember how to play golf after being away so long :(
#!perl -l $z=1;for(2..pop){$_/=5,$z/=2until$_%5;$z=$z%100000*$_}print$z%10