The error message is quite right you haven't a pin called analogPin. Either change the read to analogRead(0) (or whatever its number is), or add a line at the top:
The analogRead() function is smart enough to differentiate between digital pin 0 and analog channel 0 when you use analogRead(0);, but it makes the code more readable if you use the Ax notation when specifying the analog input pins,
analogRead(A0);
Or
const byte analogPin = A0;
int input = analogRead(analogPin);