The intersection of two squares with perimeter $8$ is a rectangle with diagonal length $1$. Given that the distance between the centers of the two squares is $2$, the  perimeter of the rectangle can be expressed as $P$. Find $10P$.