def distancia(s):
    if s[-2:].upper() == 'KM':
        dist = 1000*int(s[:-2])
    else:
        dist = int(s)
    return dist


def cursa(s):
    s = s.upper()
    posMenys = s.find('-')
    distTotal = distancia(s[:posMenys])
    if '-RELLEUS-' in s[posMenys:]:
        distTotal = distTotal * 4
    tipus = s[posMenys+1:posMenys+3]
    return distTotal, tipus
