how many sides does a regular polygon have if each exterior angle measure is 45 degrees

Please explain your answer, I really don't understand this.