Let P be a square matrix satisfying P2=I−P, where I is identity matrix. If Pn=5I−8P, then the value of n is