public static int factorsOfFiveIn(int n) { int factorsOfFive = 0; while (n > 1) { if (n % 5 == 0) factorsOfFive++; n /= 5; } return factorsOfFive; }