Which statement is logically equivalent to the following conditional statement?

"If it has exactly five sides, then it is not an octagon."

If it is not an octagon, then it has exactly five sides.
If it does not have exactly five sides, then it is not an octagon.
If it does not have exactly five sides, then it is an octagon.
If it is an octagon, then it does not have exactly five sides.

If it does not have exactly five sides, then it is an octagon.