A man has completed four consecutive marathons along the seafront in an effort to raise money for charity.