import std.stdio; import std.string; import std.algorithm; import std.ascii; void main(){ auto s = readln.chomp; string[] passwords; passwords ~= ""; foreach(c; s){ string[] children; foreach(pw; passwords){ children ~= pw ~ c; switch(c){ case 'l': children ~= pw ~ '1'; break; case 'o': children ~= pw ~ '0'; break; case 'a': children ~= pw ~ '@'; break; case 's': children ~= pw ~ '$'; break; default: } } passwords = children; } passwords.count!(a => a.any!(c => c.isLower) && a.any!(c => c.isDigit) && a.any!(c => c.isPunctuation)).writeln; }