def nb_case(R):
    case = 1
    u = 1
    somme = u
    while somme ...:
        u = ...
        somme = ...
        case = case + 1
    return case
