def leading_ones(cfg, seed):
    """ Leading ones
    score is the number of 1 starting from the first parameter
    e.g., 111001 -> 3; 0110111 -> 0
    """

    arr_ = [0] * len(cfg.keys())
    for p in cfg:
        arr_[int(p)] = cfg[p]

    count = 0
    for v in arr_:
        if v == 1:
            count += 1
        else:
            break

    return -count