You are viewing a single comment's thread. Return to all comments →
s = raw_input().strip() n = long(raw_input().strip()) count_in_s = s.count('a') print n // len(s) * count_in_s + s[0:n % len(s)].count('a')
Seems like cookies are disabled on this browser, please enable them to open this website
Repeated String
You are viewing a single comment's thread. Return to all comments →