페이지가 로드되지 않나요? 여기를 눌러보면 고쳐질 수도 있어요.
Placeholder

#3877

Secret Code 1000초 128MB

문제


입력

* Line 1: A single encrypted string of length at most 100.


출력

* Line 1: The number of ways FJ could have produced this string with one or more successive operations applied to some initial string of length at least 2, written out modulo 2014. If there are no such ways, output zero.


예제1

입력
ABABA
출력
8

출처

USACO 2014 February Silver

역링크 공식 문제집만