Hello,
reading a basic tutorial will probably be enough to learn all you need to solve this task.
Make sure you learn about data types (and basic operations on them), conditional statements and loops.
It really doesn't take too much effort to learn the basics, but it's probably not a single afternoon task if you are a beginner.
There is plenty of resources online, as well as in the Tutorials section of our forum.
If you have more questions or face coding issues feel free to post back.