def tile_h_1(current_state, goal_state):
    """
    Counts the number of tiles out of position
    :param current_state:
    :param goal_state:
    :return:
    """
    count = 0
    for y, row in enumerate(current_state.state):
        for x, item in enumerate(row):
            if item != goal_state.state[y][x]:
                count += 1
    return count