bessie cow intercept text Farmer John send Burger Queen however Bessie sure secret message hide insidethe text string s lowercase latin letter she consider string t hide string s t exist subsequence s index form arithmetic progression for example stre aab hidden string aaabb occur index 1 3 5 form arithmetic progression common difference 2 Bessie think hidden string occur time secret message two occurrence subsequence s distinct set index different help find number occurrence secret messagefor example string aaabb hide 3 time b hide 2 time ab hide 6 time aa hide 3 time bb hide 1 time aab hide 2 time aaa hide 1 time abb hide 1 time aaab hide 1 time aabb hide 1 time aaabb hide 1 time the number occurrence secret message 6