The rotation index of a plane curve