Greetings
If you want to live - learn to spin!
S. Y.
Dasha, a cultural organizer, wants to surprise her sister Ira on her birthday. She has baked a cake and arranged candles on it to form letters in a circular pattern. Now, she needs to create a greeting using these letters. However, Dasha faces a challenge: she cannot rearrange the letters without ruining the cake. Her only option is to rotate the cake so that the greeting can be read correctly.
Ira will read the letters on the cake in a clockwise direction, starting from any letter. You are given the string s, which represents one possible "reading of the cake." Your task is to determine how many ways the cake can be rotated so that the string t can be read (possibly omitting some letters at the beginning and/or end).
Input
The input consists of two non-empty strings t and s, each on a separate line. Both strings are composed of lowercase Latin letters and have a maximum length of 200000.
Output
Output the number of rotations of the cake that allow the greeting to be read.