                  FOR PUBLICATION
  UNITED STATES COURT OF APPEALS
       FOR THE NINTH CIRCUIT

JANE DOE,                               
                  Plaintiff-Appellee,
                 v.
UNITED STATES OF AMERICA;                    No. 04-35810
DONALD RUMSFELD, in his capacity
as Secretary of Defense; TRICARE               D.C. No.
                                            CV-02-01657-TSZ
MANAGEMENT ACTIVITY, formerly
                                               OPINION
Office of Civilian Health and
Medical Programs of the
Uniformed Services,
            Defendants-Appellants.
                                        
        Appeal from the United States District Court
          for the Western District of Washington
         Thomas S. Zilly, District Judge, Presiding

                    Argued and Submitted
             April 6, 2005—Seattle, Washington

                    Filed August 18, 2005

  Before: William C. Canby, Jr., Richard C. Tallman, and
          Johnnie B. Rawlinson, Circuit Judges.

                 Opinion by Judge Tallman




                            10933
10936                DOE v. UNITED STATES


                         COUNSEL

August E. Flentje, Assistant United States Attorney, United
States Department of Justice, Civil Division, Washington,
D.C., for the defendants-appellants.

Rita V. Latsinova, Stoel Rives LLP, Seattle, Washington, for
the plaintiff-appellee.


                         OPINION

TALLMAN, Circuit Judge:

                               I

   In July 2002, Jane Doe, the pregnant wife of a naval
enlisted man stationed out of Everett, Washington, learned
during a routine checkup with her obstetrician that her fetus
was anencephalic. Anencephaly is a neural tube defect that
occurs when the cephalic end of the neural tube fails to close.
Closure usually completes between the third and fourth week
of pregnancy. The tube’s failure to fully close results in a
fetus that develops without a forebrain or a cerebellum.

   Anencephaly is an ultimately and unequivocally fatal birth
defect. Approximately one-third of anencephalic fetuses car-
ried to term are born alive. Fewer than two percent that are
born alive survive more than seven days. There is no cure for
anencephaly and even extensive medical intervention and
continuous life support will not prolong the life of an anence-
phalic infant more than two months.
                    DOE v. UNITED STATES                10937
   Following the initial diagnosis, Doe obtained a second
opinion, which confirmed her obstetrician’s assessment. Doe
consulted with her doctor, medical staff, counselors, and her
family. She and her husband then made the difficult decision
to terminate her pregnancy.

   Mrs. Doe was a covered federal beneficiary under the
Civilian Health and Medical Program for the Uniformed Ser-
vices (“CHAMPUS”), now known as TRICARE. The “pur-
pose of [TRICARE] is to create and maintain high morale in
the uniformed services by providing an improved and uniform
program of medical and dental care for members and . . . their
dependents.” 10 U.S.C. § 1071. With respect to pregnancy,
TRICARE may provide funding for “medically necessary ser-
vices and supplies associated with maternity care[.]” 32
C.F.R. § 199.4(e)(16)(i). Maternity care, in turn, includes
“[c]are and treatment related to conception, delivery, and
abortion, including prenatal and postnatal care . . . and also
including treatment of the complications of pregnancy.” 32
C.F.R. § 199.2(b).

   Congress has prohibited TRICARE, however, from provid-
ing federal funds for “abortions except where the life of the
mother would be endangered if the fetus were carried to
term.” 10 U.S.C. § 1093(a). The regulation implementing this
statutory prohibition declares:

    The statute under which CHAMPUS operates pro-
    hibits payment for abortions with one single excep-
    tion — where the life of the mother would be
    endangered if the fetus were carried to term. . . .
    Abortions performed for suspected or confirmed
    fetal abnormality (e.g., anencephalic) or for mental
    health reasons (e.g., threatened suicide) do not fall
    within the exceptions permitted within the language
    of the statute and are not authorized for payment
    under CHAMPUS.
10938                DOE v. UNITED STATES
32 C.F.R. § 199.4(e)(2).

  Nonetheless, staff at the University of Washington Medical
Center, where Doe went to terminate her pregnancy,
requested payment for the procedure from TRICARE. TRI-
CARE refused to pay to terminate Doe’s anencephalic preg-
nancy.

   Doe filed a complaint in the United States District Court for
the Western District of Washington seeking a declaration that
the TRICARE statutory and regulatory scheme violated her
equal protection rights and the Administrative Procedure Act
(“APA”). 5 U.S.C. § 706. Doe concurrently filed a motion for
a temporary restraining order, seeking to enjoin the govern-
ment from withholding payment to terminate her pregnancy.
The district court granted Doe’s motion for a temporary
restraining order, and the government filed a notice of appeal
and a motion seeking an emergency stay of the district court
order. We declined to grant such a stay, and the government
voluntarily dismissed its appeal. The government then paid
for the termination of Doe’s pregnancy as ordered, electing to
proceed on the merits in district court to obtain reimburse-
ment for the costs associated with the procedure.

   The government then moved to dismiss in district court and
Doe filed a cross-motion for judgment on the pleadings. The
district court granted Doe’s motion and denied the Govern-
ment’s motion to dismiss. We have jurisdiction and now
reverse.

                               II

   We review de novo the district court’s decision to grant or
deny a motion for judgment on the pleadings. United States
v. 2,164 Watches, More or Less Bearing a Registered Trade-
mark of Guess?, Inc., 366 F.3d 767, 770 (9th Cir. 2004).

   [1] We conclude that Doe’s motion for judgment on the
pleadings under Federal Rule of Civil Procedure 12(c) before
                     DOE v. UNITED STATES                 10939
any answer was filed, an issue of first impression in this cir-
cuit, was procedurally premature and should have been
denied. The rule provides in relevant part: “After the plead-
ings are closed but within such time as not to delay the trial,
any party may move for judgment on the pleadings.” Fed. R.
Civ. P. 12(c) (emphasis added). Rule 7, entitled “Pleadings
Allowed,” defines what filings are considered pleadings and
declares which pleadings shall be filed with the district court.
It provides:

    There shall be a complaint and an answer; a reply to
    a counterclaim denominated as such; an answer to a
    cross-claim, if the answer contains a cross-claim; a
    third-party complaint, if a person who was not an
    original party is summoned under the provisions of
    Rule 14; and a third-party answer if a third-party
    complaint is served. No other pleading shall be
    allowed, except that the court may order a reply to
    an answer or a third-party answer.

Fed. R. Civ. P. 7(a). Thus, the pleadings are closed for the
purposes of Rule 12(c) once a complaint and answer have
been filed, assuming, as is the case here, that no counterclaim
or cross-claim is made. Fed. R. Civ. P. 12(c); 5C CHARLES
ALAN WRIGHT & ARTHUR R. MILLER, FEDERAL PRACTICE AND
PROCEDURE § 1367 (3d ed. 2004) (“Rule 7(a) provides that the
pleadings are closed upon the filing of a complaint and an
answer.”); see also Flora v. Home Fed. Savings and Loan
Ass’n, 685 F.2d 209, 211 n.4 (7th Cir. 1982) (“Fed. R. Civ.
P. 7(a) prescribes when the pleadings are closed.”).

  [2] Doe’s motion for judgment on the pleadings was filed
before the government filed an answer. Accordingly, Doe’s
motion was premature and should have been denied. See, e.g.,
Stands Over Bull v. Bureau of Indian Affairs, 442 F. Supp.
360, 367 (D. Mont. 1977) (denying Rule 12(c) motion for
judgment on the pleadings where defendant had not filed an
answer, stating that “[j]udgment on the pleadings under Rule
10940                DOE v. UNITED STATES
12(c) is available only when the pleadings are closed”); see
also City Bank v. Glenn Constr. Corp., 68 F.R.D. 511, 512
(D. Haw. 1975).

                               III

   Having determined that Doe’s motion for judgment on the
pleadings was untimely, we turn now to the Government’s
motion to dismiss, which the district court improperly denied.

   Doe makes two claims against the Government. First, she
alleges that § 1093(a)’s prohibition on abortion funding,
except where the life of the mother would be endangered, vio-
lates the Equal Protection component of the Due Process
Clause of the Fifth Amendment to the U.S. Constitution
because it bears no rational relationship to any legitimate state
governmental interest. Second, Doe claims that TRICARE’s
exclusion of coverage in cases of anencephaly violates § 706
of the APA because the agency action is arbitrary and capri-
cious.

   We review a district court’s denial of a motion to dismiss
de novo. Knievel v. ESPN, 393 F.3d 1068, 1072 (9th Cir.
2005). On a motion to dismiss for failure to state a claim, the
court must construe the complaint in the light most favorable
to the plaintiff, taking all her allegations as true and drawing
all reasonable inferences from the complaint in her favor. See,
e.g., id. Moreover, “a complaint should not be dismissed for
failure to state a claim unless it appears beyond doubt that the
plaintiff can prove no set of facts in support of his claim
which would entitle him to relief.” Conley v. Gibson, 355
U.S. 41, 45-46 (1957). We consider each of Doe’s claims in
turn.

                               A

  [3] Equal protection under the Fifth Amendment guarantees
no substantive rights or liberties. Harris v. McRae, 448 U.S.
                     DOE v. UNITED STATES                 10941
297, 322 (1980). Rather, it entrenches a right to be free from
discrimination based on impermissible statutory classifica-
tions and other governmental action. Id. Where such classifi-
cation is not predicated on membership in a suspect or quasi-
suspect class, the Constitution requires only that the classifi-
cation rest on grounds reasonably related to the achievement
of any legitimate governmental objective. Id. (explaining
rational basis scrutiny).

   [4] In McRae, the Supreme Court considered an equal pro-
tection claim similar to Doe’s, challenging the Hyde Amend-
ment, a restriction appended to Title XIX of the Social
Security Act that prohibited the use of federal funds to reim-
burse the cost of abortions under the Medicaid program
except under certain circumstances. McRae, 448 U.S. at 311-
18. Specifically, the Hyde Amendment provided:

    [N]one of the funds provided by this joint resolution
    shall be used to perform abortions except where the
    life of the mother would be endangered if the fetus
    were carried to term; or except for such medical pro-
    cedures necessary for the victims of rape or incest
    when such rape or incest has been reported promptly
    to a law enforcement agency or public health ser-
    vice.

Id. at 302 (quoting Pub. L. No. 96-123, § 109, 93 Stat. 926)
(alteration in original).

   The Supreme Court held that the Hyde Amendment was to
be reviewed under the rational basis standard of review,
because it dealt with no suspect categories and did not
impinge on any fundamental constitutional right. See id. at
312-323. We conclude, and the parties agree, that this reason-
ing in McRae is fully applicable here. See also Britell v.
United States, 372 F.3d 1370, 1380 (D.C. Cir. 2004) (“Britell
II”). Accordingly, we review § 1093(a) to determine whether
10942                DOE v. UNITED STATES
its restrictions are rationally related to any legitimate govern-
mental interest. Id.

   [5] McRae is, again, particularly instructive. The Supreme
Court in McRae held that the government’s “important and
legitimate interest in protecting the potentiality of human
life,” Roe v. Wade, 410 U.S. 113, 162 (1973), was rationally
related to the Hyde Amendment’s restrictions. McRae, 448
U.S. at 324. The McRae Court explained:

    By subsidizing the medical expenses of indigent
    women who carry their pregnancies to term while
    not subsidizing the comparable expenses of women
    who undergo abortions (except those whose lives are
    threatened), Congress has established incentives that
    make childbirth a more attractive alternative than
    abortion for persons eligible for Medicaid. These
    incentives bear a direct relationship to the legitimate
    congressional interest in protecting potential life.

Id. at 325.

   [6] McRae’s applicability here cannot be denied. Doe chal-
lenges a statute nearly identical to one that passed constitu-
tional muster almost 25 years ago. The only difference Doe
urges upon us, that the Hyde Amendment affects women on
Medicaid whereas § 1093(a) prohibits funding for women
covered by TRICARE, is insufficient to distinguish it from
controlling the outcome of Doe’s appeal. See Britell II, 372
F.3d at 1384. Therefore, we are bound by the Supreme
Court’s holding in McRae.

   [7] Doe claims that in her particular circumstances there is
no rational relationship between an interest in potential life
and § 1093(a)’s funding restrictions because of her fetus’ ter-
minal condition. Rational basis review, however, “is not a
license for courts to judge the wisdom, fairness, or logic of
legislative choices.” Heller v. Doe, 509 U.S. 312, 319 (1993)
                     DOE v. UNITED STATES                  10943
(quoting FCC v. Beach Communications, Inc., 508 U.S. 307,
313 (1993)). A statute “does not fail rational-basis review
because it is not made with mathematical nicety or because in
practice it results in some inequality.” Id. at 321 (citation and
quotation marks omitted). Rather, the constitutional test
requires only that the statute, as a general matter, serve a
legitimate governmental purpose. Russell v. Hug, 275 F.3d
812, 820 (9th Cir. 2002). Just as in Russell, Doe’s contention
that “we must consider [her] personal circumstances when
judging the reasonableness of [1093(a)’s funding restrictions]
is an impermissible attempt to ratchet up our standard of
review from rational basis toward strict scrutiny.” Id. Because
the statute is rationally related to a legitimate government pur-
pose, see McRae, 448 U.S. at 326; Britell II, 372 F.3d at
1380-81, and because an “imperfect fit” does not render a
statute invalid, Russell, 275 F.3d at 820, we reject Doe’s equal
protection challenge under rational basis review.

                               B

   Doe’s second cause of action alleges that TRICARE’s
exclusion of coverage under 32 C.F.R. § 199.2(e)(2) is arbi-
trary and capricious and contrary to constitutional law. The
APA provides that a reviewing court shall “hold unlawful and
set aside agency action, findings and conclusions found to be
— (A) arbitrary, capricious . . . or otherwise not in accordance
with [the] law; [or] (B) contrary to constitutional right, power,
privilege, or immunity[.]” 5 U.S.C. § 706.

   [8] For the same reasons that Doe’s equal protection chal-
lenge fails to state a claim, her claims that the implementing
regulation is unconstitutional or arbitrary and capricious
under the APA are without merit.

                               C

  We conclude our analysis with a few words of sympathy.
Anencephaly is a horrible defect that leaves families like
10944                 DOE v. UNITED STATES
Doe’s devastated, faced with difficult decisions and even
more difficult psychological experiences. We depart from our
analysis only to observe that while recognizing that the fore-
going discussion may seem at times callous and unfeeling, we
express our deepest sympathy for the families who must face
this difficult ordeal. It is the nature of the legal analysis, the
commands of stare decisis, and the deference we must afford
congressional judgment that require the result we reach here
today. We remain confident, however, that the law commands
it.

  The judgment of the district court is REVERSED.
