def romaine_v1(string):
    """
    (str) -> int
    Converts roman numerals to arabic numerals using string methods.
    Restrictions: string must consist of M, D, C, X, V, and/or I. Otherwise it
    will return 0 (which is to be expected anyway).
    """
    string = string.strip()
    string = string.lower()

    nombre_M = string.count('m') * 1000
    nombre_D = string.count('d') * 500
    nombre_C = string.count('c') * 100
    nombre_X = string.count('x') * 10
    nombre_V = string.count('v') * 5
    nombre_i = string.count('i') * 1

    return nombre_M + nombre_D + nombre_C + nombre_X + nombre_V + nombre_i