#C7094. Count Possible Strings
Count Possible Strings
Count Possible Strings
You are given a string s
that consists of lowercase English letters and the special character *
. For every occurrence of *
in the string, you can replace it with any of the 26 lowercase English letters. Your task is to calculate the total number of distinct strings that can be obtained by replacing all *
characters.
Mathematically, if the number of *
characters in s
is n, then the answer is given by:
\(26^n\)
For example, if s = "a*c"
, then there is 1 asterisk, and the answer is \(26^1 = 26\). If s = "b**d"
, then there are 2 asterisks, so the answer is \(26^2 = 676\).
inputFormat
The input consists of a single line containing the string s
which may include lowercase letters and the character *
. The length of the string is at least 1.
outputFormat
Output a single integer, the number of distinct strings that can be formed by replacing each *
with any lowercase English letter.
abcdef
1