To get the blue dye production starting again you need to log in to the irrigation system of the garden section. Once again you need a password to do so but the password guidlines of course forbid just writing down the password somewhere. Instead you are given a list of regular expressions describing the properties a proper password ought to have — like this:
[eirv][begl]
[cinr][gqt][bcex]
[ghkl][cnsx]
.[egl][akx]
[ruy][giv].
There is exactly one regular expression (regex for short) given per line. We say that a regex matches if the pattern described by the regex appears anywhere inside the password. A . means to match any one letter as the password guidelines say that passwords must only consist of lowercase letters. A list of characters between brackets match any one of the listed characters. So [abc] would match either a, b or c. As an example the regex [ab].[bc] would match the passwords abc, xbyc, xbbby and many more.
We can assess the security of each regex by how many potential passwords it matches. For example of all the possible 3-letter passwords, 816 of them are being matched by [eirv][begl]. We call that number the security grade. Adding up all the grades for each regex from our example above we get a total of 816 + 48 + 832 + 234 + 234 = 2164.
What's the security grade of your input when considering 5-letter passwords?