Solved CountDiv in java