Schematically:
- Open the text file
- Read it line-by-line and build a list of last names
- You then have a list of last names, against which you will be able to write things like
int numberOfPeopleWithLastNameSnow = list.Where(s => s == "Snow").Count();
- The only part left is deciding how you are going to handle user inputs.
Good luck. With more specific questions would come more specific answers.