the british army departed new york from sandy hook , new jersey , courtesy of the british navy a few days later , in late july 1777 , and , after encountering a number of delays , finally arrived at head of elk , maryland in late august 1777 .