; (B) subject to paragraph (2), has less than 51 acute care inpatient beds, as reported in its most recent cost report; (C) makes available 24-hour emergency care services; (D) subject to paragraph (3), has a provider agreement in effect with the Secretary and is open to the public as of January 1, 2010; and (E) applies to the Secretary for such designation. (2) For purposes of paragraph (1)(B), beds in a psychiatric or rehabilitation unit of the hospital which is a distinct part of the hospital shall not be counted. (3) Paragraph (1)(D) shall not be construed to prohibit any of the following from qualifying as a rural community hospital: (A) A replacement facility (as defined by the Secretary in regulations in effect on January 1, 2012) with the same service area (as defined by the Secretary in regulations in effect on such date). (B) A facility obtaining a new provider number pursuant to a change of ownership. (C) A facility which has a binding written agreement with an outside, unrelated party for the construction, reconstruction, lease, rental, or financing of a building as of January 1, 2012. (4) Nothing in this subsection shall be construed as prohibiting a critical access hospital from qualifying as a rural community hospital if the critical access hospital meets the conditions otherwise applicable to hospitals under subsection (e) and section 1866. (5) Nothing in this subsection shall be construed as prohibiting a rural community hospital participating in the demonstration program under section 410A of the Medicare Prescription Drug, Improvement, and Modernization Act of 2003 ( Public Law 108–173