It’s not a problem if the map doesn’t yet contain that key. The first time a new line is seen, the expression counts[line] on the right-hand side evaluates to the zero value for its type, which is 0 for int.
Faz sentido qude seja assim psela filosofia da linguagen mas eh bem ruim por esconder erros