"""For a string of intervals (such as generated by between.py) calculates various statistics using S=3 and L=1332"""

#matrix [1,2] represents the number of twos that follow a 1
matrix = [[0 for i in range(4)] for j in range(4)]

data = input()


#Word substitutions
data = data.replace("1332", "1")
print(data[:250])

for i in range(len(data) - 1):
    currentDigit = int(data[i])
    nextDigit = int(data[i + 1])
    matrix [currentDigit] [nextDigit] += 1
    #if i % 10000 == 0:
    #    print(i)
for i in [1, 3]:
    total = max(1, sum(matrix[i]))
    percent1 = (int)((100 * matrix[i][1]) / total)
    percent2 = (int)((100 * matrix[i][2]) / total)
    percent3 = (int)((100 * matrix[i][3]) / total)
    print("Digit {}: {}% L, {}% S, Total: {}".format('S' if i == 3 else 'L', percent1, percent3, total))
