Since this is very basic, I recommend this :
These are really great tutorial. For your actual question, here is a blueprint that will do exactly as you asked:
Only the first part is needed, (the SET), after that it’s only to print the result on the screen.
Hopes this sets you on the right path to learning UE4
Mick