pos = [0, 0]
s = str(input())
pc = {"L": (-1, 0), "R": (+1, 0), "U": (0, +1), "D": (0, -1)}
for a in s:
    if a in "LRUD":
        pos[0], pos[1] = pos[0] + pc[a][0], pos[1] + pc[a][1]

print(pos[0], pos[1])
