use bigint;<>;%0=(0,-//,%1),map$1{bgcd{0+$'}$_}+=$0{$_},keys%0for glob<>;print-$1{1}