solved task 3

solved task 3 from Rusovich Yuriy