Page not loading? Try clicking here.
Placeholder

#3877

Secret Code 1s 128MB

Problems


Input

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


Output

* 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.


Example

ABABA 
8 

Source

USACO 2014 February Silver

You must sign in to write code.