The first sentence uses a "double genitive", and some people will tell you it is wrong. However, both sentence types are in common use, and have been for a long time. Personally, I use only one genitive, but it's mostly a matter of personal choice.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.