#length = input()
merkit = "...........*................**.....*......................................*...*...........*..*............................*.......................*............................*.*.............*..*..*..................*..........*.*....................*........*......*..............*.........*..........*.............................**..*...........*.........*...................*..*..*..........*...*......*........*......................*..................*...........*.................*..*..*.........................**.*.**.............**..........*..*..*........*..............**..............*...............................*****...*.*.....*..*.......*..........*....*................*...............................***...*.***.........*..............*.*..........**..............*..........*....*......*............*...........*..........*.*.....**.*.*.......*...*..**...*.........................*.................*..................*..*.....*.........................*.**.....*.................*.....*.*........................................*...........*..........................**...........................................*.......*....................*...*..*..................*........*..*...............*.....*.*.*..*....**.................................*......*.*........*...*..............**...*........*.*........*.......*...*.........*.....*..........*..........*........*..................*..............*....*.....*........*........*.......*.......*.*......*........**............*....*...........**.....**.......................*....*.................*....................*.....*.*.............*..................*..*.......*.**.............*.*..*..*.........**.......*.......*.................*............................................*.........*...............*....*...*...............*...**.....**.*...................*......*..*.............*............................*...........*..*.*.....*...*.......*.........*.................................*.....................................**.............................*..*.*................*......*...........................................*.........*...........*....*.............................*.....*................*...*...................*........*.....*.................................**........................*.....*..........................**.....*.............*....*.......*.......*......*.......................................*.....*.......................*.........*...........*...........*.............*..............*.....*.............*........................*.*..*........*........*..*.........*...*........*..............*....*....................*.*...*...........*.*.*...........*..........*............................*..*.....*.*...*................*.......*.........*................*.......**...................................*...............**....................................*.*......................*.....................*......*...*................................*........*.....*...*.....*........*......**...............*............*..*..*...*...*..*...*............*.*.*...*...................*..........*.......................................*...*...*...........................*..*............*.................**..........*........*..............................*.........*.**.**..*.............*...............*......*.......................*..................**.........*.........................*........*.*.......................................*..........*..........................*.*........**..*..*........*....*.....*.*.............*....*...*...........*.......*.*.........*.*....*..**....*...........*..*...*.......*................*.*..................................*..*....**.......**...............*...........*......*.....*.*..*......................*............................**......*.......*......................................*.........................*.....*............*........**.......*.*.........*...........*..*....*.....*.............*...............*...*........*....*....*..............*..................**.......*.........*.*.*....*..........*...........*...............................*.*............................*..........*..**...**.............**.......*.*............*.......*............*..............*....................***......................*............*.....*...*................*.......*..*.*...............................*.......................*.............**...*......*......*......*....*.*........*......*.........*..*.....**.*..*.*..*..............................*...*.........................*.........................*...*.........*......................*.....................*........................*......*.*..**........*.........*...............*.........*....*.......**..*................*...........*.....*.*.................*.*.....*.........*...........*.........*.....*.....*..**...*.......*..*.......*......*...........*......*.*.............*..................*..............*...**.....*.................*..*...................................*..*.........*.......................*.....................*.......*....*.......**...*....*.......**.*.................*......*.....................*.....*......*..................*.................*.....*.....................*.*........*............*.............*.**......*.....**..........*..**.....*.............*...*..................*..*...........*...........*..........*...*.*............*....*.......*....*..........*..*.........*...............*.*.............*.............................*...***.............*.*....*...................*.......R*......**.**.................**......................*.......................*............*...*................*...*.....*...................*.....................*..........*........*...................*...*........................*...........*.....*........*...............*......*.......*..............................*...*...........*........*.....*.....................**..........*..*...............*....*........*..............*..**..........*............*.......*................*.....*.......*.............*............*..............*.................*...............*.......*.............*............*....*....*...............*.....*.................*..*....*.....*............*.........*......**..*..*.......*..*........................*..*....*...........................*..*..**......*.....*.....*......*..............*..........*..................*............*..*.........................*....*...........................*...........*.....*......*............*..*.................*......*....*.......*..............*..........**.............*........*........*..*......*.......*.....*.......*............*......*............*.............**.*.....**....*........*........................*...........................*.....*......*................................................................*.................................*.........................*.................*......................................*.................*.............*...............................*.........*....................*........*..*..........*..*...*.....*.*....................*.*................*.............**......................**..........***..*.........*..**....*...............*....................*...................*...............*.....***.*.........*.........*.*.....**...............*.....*.........*............*.......*..........*.......*.......**.............*...*.......*............*....*..*....................*.........*.......*.....*.......*..*....*..................*.....*............*....*...*..............*........*...*..................*..*...........*....*..*....*......*.....*................................*.................*....................*......................*.*.*.....*...*....*............*.......*......**........*.......................*...*.......................*.......................*...............*.................*...*..*.........*.......*....*......................................*..............*........*...*.................*............*........*...............**.......*.............*............*....*....*...*.................*........*.......*..........*.......*.......*................................*..*........*.....................*....*...........*.....*.........**.**...........*........................*.....*..*..........*....................*..*......................*...*.*...**...*.............*.........*..................*.*.............*.*...*.....*..............*............*....*............*...........*....*..*...*.......**.......*.....*.*......*.......*..............*....**...*...........*.*.......................................*............*.....................*.....*...........................*....*...*................................*.*...................*...**............*....................*......*....*..............*.*.....*....*..................*.....................*............................*........**.......*............*......................*.........*....*.............*....*.*.*.................*...............*..........................**......*.........*....*.................*...*..............*.........*..*.......*.............................*...*.*...........*....*..........**..........**....*....***.......*..*....*.....*................*....*......*............................................*............*.*.....*..*.......................*...*........................................*.......**.............*.......*...........**.............*...........*........*............*............*............*......*.......................*.......*...........*.........*...*..*.................*.................................***.......................*.......**.***...*...........*.*.*...........*.*........................*...............**....................*......*...................................*..............*.....................*..........*.*.................."
a = merkit.split("R")
b = list(a[0])[::-1]
c = list(a[1])
outDist= 0
dist = 0
coin = 0
b.insert(0, '.')
c.insert(0, '.')
needToCheckB = True
needToCheckC = True
isc = "*" in c
cx = c.index("*")
 
while True:
    if needToCheckB:
        isb = "*" in b
        if isb:
            bx = b.index("*")
    else :
        isc = "*" in c
        if isc:
            cx = c.index("*")
    if isb and isc:
        if bx + dist < cx - dist:
            b[bx] = '.'
            outDist += bx + dist
            dist = -bx
            coin += 1
            needToCheckB = True
 
        elif bx + dist > cx - dist:
            c[cx] = '.'
            outDist += cx - dist
            dist = cx
            coin += 1
            needToCheckB = False
        else:
            break
 
    elif isb and not isc:
        blen = len(b)-1     
        blast = b[::-1].index("*") 
        outDist += blen-blast-dist  
        coin += b.count("*")
        break
 
    elif isc and not isb:
        clen = len(c)-1     
        clast = c[::-1].index("*") 
        outDist += clen-clast-dist  
        coin += c.count("*")
        break
    else:
        break
 
    
print(outDist, coin)