{"problem":{"name":"Three Substrings","description":{"content":"Snuke has a string $s$. From this string, Anuke, Bnuke, and Cnuke obtained strings $a$, $b$, and $c$, respectively, as follows: *   Choose a non-empty (contiguous) substring of $s$ (possibly $s$ itse","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"panasonic2020_e"},"statements":[{"statement_type":"Markdown","content":"Snuke has a string $s$. From this string, Anuke, Bnuke, and Cnuke obtained strings $a$, $b$, and $c$, respectively, as follows:\n\n*   Choose a non-empty (contiguous) substring of $s$ (possibly $s$ itself). Then, replace some characters (possibly all or none) in it with `?`s.\n\nFor example, if $s$ is `mississippi`, we can choose the substring `ssissip` and replace its $1$\\-st and $3$\\-rd characters with `?` to obtain `?s?ssip`.\nYou are given the strings $a$, $b$, and $c$. Find the minimum possible length of $s$.\n\n## Constraints\n\n*   $1 \\leq |a|, |b|, |c| \\leq 2000$\n*   $a$, $b$, and $c$ consists of lowercase English letters and `?`s.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$a$\n$b$\n$c$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"panasonic2020_e","tags":[],"sample_group":[["a?c\nder\ncod","7\n\nFor example, $s$ could be `atcoder`."],["atcoder\natcoder\n???????","7\n\n$a$, $b$, and $c$ may not be distinct."]],"created_at":"2026-03-03 11:01:14"}}