Your first line, which attempts to get the number of frames does not work for me. For whatever reason my test files report 'N/A' rather than a number. But since it worked for you, you were almost done.
If you know that you want to remove frame number $lf, you can just do the following:
ffmpeg -i "$fn" -frames:v $frames -c:v copy -c:...