We need to read a string s of length between 1 and 20 (inclusive) consisting of lowercase letters. We have a base photobook as string s. We are to insert exactly one extra photo (character from 'a' to 'z') anywhere in the booklet: this means we can insert a character at any position, including before the first character, between any two characters, and after the last character. So we generate all strings of length |s| + 1 obtained by taking s and inserting one character c from 'a' to 'z' at some position pos from 0 to |s| (where 0 is before first, |s| is after last). We need to count the number of distinct resulting strings.
So the answer is the number of distinct strings over alphabet of size 26 that can be obtained by inserting one character into s.
We need to consider duplicates: different insertion positions and/or characters could yield the same final string. For example, if s = "aa", inserting 'a' at beginning gives "aaa", inserting 'a' after first also "aaa", after second also "aaa". So duplicates arise.
Goal: compute number of distinct strings of length n+1 formed by inserting a character into s.
Given small constraints (|s| ≤ 20), we could just generate all possibilities (26 * (n+1) ≤ 26*21=546) and then use a set to count distinct strings. That's trivial and would be accepted. But we can also derive formula maybe, but given small constraints, brute-force is fine.
But note that examples: Input "a": length 1. Possibilities: insert any char before or after. Insert before: c + "a" -> 26 strings. Insert after: "a" + c -> 26 strings. But one duplicate: when c = 'a' both before and after give "aa"? Wait "a"+"a" = "aa", and "a"+"a" also for after? Actually before gives "aa", after gives "aa". So there is one duplicate. So total distinct = 26+26-1 = 51. So example matches.
Input "hi": length 2. Without duplicates? Possibly duplicates? The answer 76. Let's compute: total insertion positions: 3 positions (0,1,2). For each position, 26 choices. So total raw = 78. So there must be 2 duplicates to give 76. Which duplicates? For "hi", consider inserting 'h' at position 0 yields "hhi". Inserting 'h' at position 1 yields "hhi"? Actually if we insert at position 1 (between 'h' and 'i'), we get "h" + 'h' + "i" = "hhi". Inserting 'h' at position 2 yields "hih"? Actually "hi" + 'h' = "hih". So duplicate: insertion of 'h' at pos 0 and pos 1 both give "hhi". That's one duplicate. Similarly, inserting 'i' at position 1 and position 2 both give "hii"? Check: pos1: "h" + 'i' + "i" = "hii". pos2: "hi" + 'i' = "hii". That's second duplicate. So total 78 - 2 = 76.
Thus answer seems to be 26*(n+1) - D, where D is number of collisions when two different insertion operations yield the same string.
We can compute D easily by generating all possibilities and counting distinct. So simplest solution: loop over each position (0..len(s)), for each character c in 'a'..'z', construct string s[:i] + c + s[i:], add to set, output size of set.
But since input length up to 20, we could even generate manually.
Implementation details: read string s, compute n = len(s). Use set of strings. For i in range(n+1): for c in 'abcdefghijklmnopqrstuvwxyz': new = s[:i] + c + s[i:]; add to set. Then print len(set).
Edge cases: s length 20, number of generated strings = 26*21=546. Set size at most 546. So trivial.
But maybe there is a twist: duplicates could also arise from inserting same character at two positions that produce same string due to repeated patterns? Already covered.
Thus problem is straightforward.
But perhaps the problem expects to be solved mathematically? Possibly but we can just brute force.
Given constraints, it's fine.
We need to output a single integer.
I'll implement in Python.
But careful: the input string s may include any lowercase letters, but not necessarily distinct. Duplicates within s could cause more collisions.
Test: s = "aa": n=2, positions=3, total raw=78. Let's compute distinct set manually: Insertion of 'a' at any position: position0 -> "aaa", pos1 -> "aaa", pos2 -> "aaa". So only one string "aaa". For other characters 'b'...'z', each insertion yields distinct strings? For 'b', pos0: "baa", pos1: "aba", pos2: "aab". All distinct unless s contains some pattern that cause collisions. So 'b' yields 3 distinct strings. So total distinct: for 25 other letters: each yields 3 distinct strings (assuming no further collisions). But check if any other collisions could occur across different characters? For instance, 'b' inserted at pos0 yields "baa". Could that equal some other insertion? e.g., 'a' inserted at something? "baa" vs "a" insertion? Unlikely because first character is 'b' vs 'a'. So distinct. So total distinct = 1 (for 'a') + 25*3 = 1+75 = 76. So answer for "aa" would be 76? But let's test via brute: raw 78, duplicates: for 'a' there are 3 insert positions giving same string -> 2 duplicates among those (since three operations produce same string, the number of distinct strings contributed is 1, so duplicates = 2 for that char). Are there any other duplicates? Possibly 'b' at pos0 yields "baa". Could "baa" also be obtained by inserting something else? For example, inserting 'a' at some position? No. So no. So total duplicates = 2. So answer = 78-2=76. So indeed.
Thus approach works.
So final answer: generate all and count distinct.
We can write solve().
Time complexity O(26*(n+1)* (n+1) due to string concat but trivial).
We can also precompute something but not needed.
Edge: s length 1? Works.
Thus solution.
But note: input may have trailing newline. Use sys.stdin.readline().strip().
Ok.
Now, produce final answer. ```python
import sys
def solve() -> None:
s = sys.stdin.readline().strip()
n = len(s)
distinct = set()
for i in range(n + 1): # insertion positions
for c in "abcdefghijklmnopqrstuvwxyz":
new_str = s[:i] + c + s[i:]
distinct.add(new_str)
print(len(distinct))
if name == "main":
solve()