Function to find the required count
def findCount ( N , K , arr ) : NEW_LINE INDENT count = 0 ; NEW_LINE for i in range ( K ) : NEW_LINE INDENT if checkLastDigit ( arr [ i ] ) == 1 : NEW_LINE INDENT count += 1 NEW_LINE DEDENT else : NEW_LINE INDENT count NEW_LINE DEDENT DEDENT print ( count ) NEW_LINE DEDENT