This is solution for problm 17