INPUT:

OUTPUT:

Please refer to above attached pics of INPUT and desired OUTPUT. I was able to flag the different ID's but I was not able to start a new count/ record ID every time a new ID came up. It might be a really simple solution but I am confused. Any help will be appreciated. Thanks!
I have attached the INPUT and desired OUTPUT files.