There are $ 26^2 = 676 $ possible unique last names.
If $ n = 676+1 $, then we can guarantee that in the worst case scenario where the first 676 people all have different last names, the 677th person needs to pick a last name that’s already been taken