; or (ii) a major disaster or emergency designated by the President under the Robert T. Stafford Disaster Relief and Emergency Assistance Act ( 42 U.S.C. 5121 et seq.). ; and (2) in paragraph (2)— (A) by striking The total and inserting the following: (A) In general Subject to subparagraph (B), the total ; and (B) by adding at the end the following: (B) Certain producers in disaster counties The total amount of payments received, directly or indirectly, by a person or legal entity (excluding a joint venture or general partnership) in a disaster county under this subsection may not exceed $625,000 for the period of the 2017 through 2022 crop years. . 411. Treatment of certain producers as socially disadvantaged farmers and ranchers Section 2501 of the Food, Agriculture, Conservation, and Trade Act of 1990 ( 7 U.S.C. 2279 ) is amended by adding at the end the following: (j) Treatment of certain producers For purposes of administering any grant program and conservation program of the Department of Agriculture, the Secretary shall consider an agricultural producer operating in the Commonwealth of Puerto Rico, the United States Virgin Islands, or both, to be a socially disadvantaged farmer or rancher. . 412. Emergency watershed protection program Section 403 of the Agricultural Credit Act of 1978 ( 16 U.S.C. 2203 ) is amended by adding at the end the following: (c) Federal share For each of fiscal years 2018 through 2022, the Federal share of the cost of any emergency measure under this section or section 7 of the Act of June 28, 1938 ( 33 U.S.C. 701b–1 ), in the Commonwealth of Puerto Rico or the United States Virgin Islands shall be 100 percent. . 413. Emergency forest restoration program Section 407(d) of the Agricultural Credit Act of 1978 ( 16 U.S.C. 2206(d) ) is amended— (1) by striking Payments and inserting the following: (1) In general Subject to paragraph (2), payments