covered voyage, the ratio (expressed as a percentage) of— (i) the number of days during such voyage such ship was operated in the territorial waters of the United States, divided by (ii) the total number of days of such voyage. (B) Calendar day rule If a ship— (i) is operated in a covered voyage, or (ii) is operated in the territorial waters of the United States during a covered voyage, for any portion of a calendar day, such ship shall be treated as having operated in a covered voyage, or as having operated in such territorial waters, respectively, for the entirety of such day. (C) Territorial waters The territorial waters of the United States shall be treated as consisting of those waters which are— (i) within the international boundary line between the United States and any contiguous foreign country, or (ii) within 12 nautical miles from low tide on the coastline of the United States. (4) Covered voyage For purposes of this subsection— (A) In general The term covered voyage has the meaning given such term by section 4472(1). (B) Anti-abuse rule Except as otherwise provided by the Secretary, if passengers embark a ship in the United States and more than 10 percent of such passengers disembark in the United States, the operation of such ship at all times between such events shall be treated as a covered voyage. Nothing in the preceding sentence shall preclude any operation of a ship (including any operation of a ship before or after such events) which would otherwise be treated as part of a covered voyage from being so treated. (5) Treatment of otherwise effectively connected income Gross income which would, without regard to this subsection, be gross income which is effectively connected with the conduct of a trade or business in the United States— (A) shall be so treated, and (B) shall not be taken into account as gross income under paragraph (2). . (b) Application to nonresident alien individuals Section 871 is amended by redesignating subsection (n) as subsection (o) and by inserting after subsection (m)