The value of the amount attribute may already be a number so the first int(0) may be unnecessary. However the state value of all entities, including an Input Number, is a string and must be converted to a number before performing any arithmetic operations (so the second int(0) is required).
A template appearing on the same line as the YAML option should be wrapped in quotes.