The variable on the left of the = is an int. The method on the right of the = does not return an int.
Use a cast to change the value to an int.