Out of a sincere religious belief that universal numbers are “the mark of the beast” by which the Antichrist endeavors to control mankind, Robert Dale Callahan seeks to receive Aid to Families with Dependent Children benefits without having to obtain a social security number for his infant daughter. The district court granted summary judgment against Callahan, ruling that the burden on Callahan’s religious exercise was outweighed by the government’s compelling interest in having aid recipients classified by number, and that the number requirement was the least restrictive means of administering the AFDC program. On appeal, Callahan asks this court to reverse the summary judgment and instruct the district court to enter judgment in his favor on the ground that “administrative viability” cannot constitute the compelling state interest required to override a protected religious belief. Because neither party is entitled to summary judgment on the facts presented, we remand to the district court for further proceedings.
FACTS AND PROCEDURAL BACKGROUND
State participation in the Aid to Families with Dependent Children program (“AFDC”), 42 U.S.C. § 601 et seq., is optional. To participate, a state must submit to the Secretary of Health and Human Services (“HHS”) a plan that meets all the requirements of the federal statute, 42 U.S.C. § 602(a), and the implementing federal regulations, 42 U.S.C. § 602(b); 45 C.F.R. § 201.2.
Section 602(a)(25), added in 1974, provides:
(A) that, as a condition of eligibility under the plan, each applicant for or recipient of aid shall furnish to the State agency his social security account number (or numbers, if he has more than one such number), and (B) that such State agency shall utilize such account numbers, in addition to any other means of identification it may determine to employ in the administration of such plan____
(Emphasis added.) “Applicant” and “recipient” are defined in the implementing regulation as including “the caretaker relative, the children, and any other individual whose needs are considered in determining the amount of assistance.” 45 C.F.R. § 232.10(f). Accordingly, the State of California has adopted regulations which comply with the federal social security number (“SSN”) requirement. See E.A.S. (eligibility and assistance standards) § 40-105.2.
In 1979 Robert Dale Callahan sought to enjoin the Director of the California Department of Social Services and the Secretary of HHS from requiring him to obtain a social security number for his infant daughter, Serena, in order to receive AFDC benefits to which his family was otherwise entitled. Callahan claimed that compliance with the regulation requiring an SSN would impermissibly burden his first amendment right to free exercise of his religious beliefs. Specifically, he claimed that the Book of Revelation condemns the use of a universal number to designate a human being because such a number is the “mark of the beast” through which the Antichrist seeks to control mankind.1 Cal*1272lahan therefore refused to force his daughter to assume that mark.
Earlier in this lawsuit, the district court held that while Callahan’s beliefs were sincere, they were not entitled to first amendment protection because they arose in a purely secular context and were not therefore “rooted in religious belief.” Callahan v. Woods, 479 F.Supp. 621, 622 (N.D.Cal.1979). This court reversed the award of summary judgment, holding that Callahan’s beliefs were religious and therefore protected by the first amendment. It remanded the case to the district court to consider: 1) the extent to which Callahan’s beliefs are burdened by the government’s SSN requirement; and 2) whether the government regulation is the least restrictive means of achieving some compelling state interest. Callahan v. Woods, 658 F.2d 679, 687 (9th Cir.1981).
On remand, the district court, 559 F.Supp. 163, determined that the burden on Callahan, although substantial, was heavily outweighed by the government’s compelling interest in having aid recipients classified by SSNs, and that the requirement is the least restrictive means of administering efficiently an enormous social welfare program. The court based its grant of summary judgment for the government on the detailed affidavits of two HHS officials which describe the origins, use, and operation of the SSN system in the AFDC program. Callahan appeals.
ISSUE
Was the district court correct in ruling as a matter of law that a regulation requiring the assignment of a number to every social security recipient is the least restrictive means of furthering a compelling state interest?
STANDARD OF REVIEW
Grants of summary judgment are reviewable by this court de novo. National Union Fire Insurance Co. v. Argonaut Insurance Co., 701 F.2d 95, 96 (9th Cir.1983). Summary judgment has been properly granted when it appears that there was no genuine issue as to any material fact and that the moving party was entitled to judgment as a matter of law. Fed.R.Civ.P. 56(c). In this case, Callahan did not argue below and does not argue here that disputed issues of fact precluded summary judgment. Rather, he contends that the government cannot prevail as a matter of law. We must therefore accept the uncontested government affidavits as the facts of this case to which the law must be applied.
DISCUSSION
I. Formulating the Applicable Test
The government must shoulder a heavy burden to defend a regulation affecting religious actions. It is usually said that the challenged regulation must be the least restrictive means of furthering a compelling state interest. See, e.g., Wisconsin v. Yoder, 406 U.S. 205, 92 S.Ct. 1526, 32 L.Ed.2d 15 (1972); Sherbert v. Verner, 374 U.S. 398, 83 S.Ct. 1790, 10 L.Ed.2d 965 (1963).
Commentators have observed that, because of its broad and indefinite nature, this test is often inadvertently reduced to an inquiry which stops after the discovery of a compelling state interest. See, e.g., Tribe, American Constitutional Law 855 (1978). The purpose of almost any law, however, can be traced to .a fundamental concern of government. Balancing an individual’s religious interest against such a concern will inevitably ,make the former look unimportant. It is therefore the “least restrictive means” inquiry which is the critical aspect of the free exercise analysis. This prong forces us to measure the importance of a regulation by ascertaining the marginal benefit of applying it to all individuals, rather than to all individuals except those holding a conflicting religious conviction. See Clark, Guidelines for the Free Exercise Clause, 83 Harv.L.Rev. 327, 331 (1969). If the compelling state goal can be accomplished despite the exemption of a particular individual, then a regulation which denies an exemption is not the least *1273restrictive means of furthering the state interest. A synthesis of the two prongs is therefore the question whether the government has a compelling interest in not exempting a religious individual from a particular regulation. See, e.g., Sherwood v. Brown, 619 F.2d 47, 48 (9th Cir.1980) (compelling state interest in not exempting Sikh from Navy helmet requirement because absence of single helmet would endanger entire crew). Such a formulation prevents the government from relying on its generally great interest in maintaining the underlying rule or program for unexceptional cases.
This court has adopted a method of analyzing free exercise claims which accurately reflects the relevant concerns. In determining whether a neutrally based statute violates the free exercise clause, we consider three factors:
(1) the magnitude of the statute’s impact upon the exercise of the religious belief;
(2) the existence of a compelling state interest justifying the burden imposed upon the exercise of the religious belief; and
(3) the extent to which recognition of an exemption from the statute would impede the objectives sought to be advanced by the state.
E.E.O.C. v. Pacific Press Pub. Assoc., 676 F.2d 1272, 1279 (9th Cir.1982), citing Wisconsin v. Yoder, 406 U.S. 205, 92 S.Ct. 1526, 32 L.Ed.2d 15 (1972), and Sherbert v. Verner, 374 U.S. 398, 83 S.Ct. 1790, 10 L.Ed.2d 965 (1963).
II. Applying the Test
A. Magnitude of Impact
Appellees, although content with the result below, argue that, the district court was not required to find a “compelling state interest” because the burden in this case, although substantial, was indirect rather than direct. They argue that the constitutionality of regulations imposing only an indirect burden upon the exercise of religious beliefs must be assessed by merely balancing the burden against the government’s interest supporting the regulation.
This contention is without merit. Thomas v. Review Board of the Indiana Employment Security Division, 450 U.S. 707, 101 S.Ct. 1425, 67 L.Ed.2d 624 (1981), states that “[wjhile the compulsion [upon an individual to modify his religious beliefs to receive benefits] may be indirect, the infringement upon free exercise is nonetheless substantial.” Id. at 718, 101 S.Ct. at 1432. A substantial burden is justified only by a showing that the requirement is the least restrictive means of achieving some compelling government interest. Id.
In United States v. Lee, 455 U.S. 252, 257, 102 S.Ct. 1051, 1055, 71 L.Ed.2d 127 (1982), the Court similarly asked only whether the challenged requirement “interfered” with the litigant’s free exercise, not whether the interference was direct or indirect. While it is true that the Supreme Court has phrased the test in somewhat different ways, see, e.g., Wisconsin v. Yoder, 406 U.S. 205, 92 S.Ct. 1526, 32 L.Ed.2d 15 (1972) (overriding state interest); Sherbert v. Verner, 374 U.S. 398, 83 S.Ct. 1790, 10 L.Ed.2d 965 (1963) (compelling state interest), the Court generally comes close to applying strict scrutiny when a regulation imposes a substantial, albeit incidental, burden on religious belief. See Choper, Kamisar, & Tribe, The Supreme Court: Trends and Developments 1981-1982 at 56 (1983). The only two courts which have considered the precise issue in this case applied the compelling state interest standard. See Mullaney v. Woods, 97 Cal.App.3d 710, 158 Cal.Rptr. 902 (1979); Stevens v. Berger, 428 F.Supp. 896 (E.D.N.Y.1977). We conclude that the SSN requirement substantially interferes with the free exercise of Callahan’s religious beliefs. Accordingly, the compelling state interest test applies.
*1274B. Compelling State Interest
In determining whether the government 2 has a compelling interest in a particular regulation, it is useful to look first at the importance of the value underlying the regulation, and second, at the degree of proximity and necessity that the chosen regulation bears to the underlying value. See Giannella, Religious Liberty, Nonestablishment, and Doctrinal Development, 80 Harv.L.Rev. 1381, 1390 (1967).
The value of the AFDC program, a nationwide social welfare system, is undeniably important. Cf. United States v. Lee, 455 U.S. 252, 258, 102 S.Ct. 1051, 1055, 71 L.Ed.2d 127 (1982) (social security system). The AFDC program exists to encourage the care of needy dependent children in their own homes by enabling each state to provide financial assistance to the parents and relatives with whom these children live. 42 U.S.C. § 601. Such assistance is intended to strengthen family life and help families attain the maximum self-support and personal independence consistent with the maintenance of continuing parental care and protection. Id. We have no trouble concluding that the AFDC program, which reaches millions of American families each month, promotes a government interest of the highest importance.
Additionally, the proximity and necessity of the challenged regulation to the underlying value is clear. The regulation requiring SSNs for AFDC recipients appears to be essential for the system’s efficient operation, because the use of SSNs as unique identifiers is by far the most cost-effective means of administering the program.3 According to the government affidavits, which were not contested by Callahan, the development and maintenance of an alternative non-numerical system would cost nearly one billion dollars. These facts suggest that conversion to a non-SSN system for unexceptional cases would introduce massive inefficiencies into the AFDC scheme. We conclude, therefore, that the SSN regulation promotes a compelling state interest.
C. Cost of Exempting Callahan
We now turn to the most critical aspect of our free exercise inquiry: the extent to which exempting Callahan from the SSN requirement would impede the goal of administrative efficiency.
The affidavits submitted below fail to address the potential cost, financial or otherwise, of exempting one person from the SSN requirement. They state only that “conversion to ... a non-numerical system would cost in excess of 900 million dollars.” There was no evidence below, however, that the exemption of one person from the number requirement would mandate the development of an entire non-numerical system.4 There was also no evidence that any more than one person holds Callahan’s religious beliefs.5 Absent such evidence, *1275the district court was completely unable to address the third, and most critical, prong of the free exercise inquiry.
Because it did not have the relevant facts before it, the district court could not properly have found that exempting Callahan from the SSN requirement would be incompatible with the government’s efficient operation of the AFDC program. Such a finding is a prerequisite to the conclusion that the SSN regulation is the least restrictive means of furthering a compelling state interest. We must therefore reverse the grant of summary judgment for the government.
Callahan urges us to grant summary judgment in his favor because the government, which had the burden of proving that an exemption would impede administrative efficiency, failed to establish the cost of exempting Callahan. While we have the power to grant summary judgment to an appellant, see Wright & Miller, 10 Federal Practice and Procedure § 2716 at 660-61 (1983), we hesitate to do so if it would unfairly deprive the other party of the opportunity to present pertinent evidence. It is possible that the law, before this appeal, was not sufficiently clear to have afforded the government a realistic opportunity to present the relevant facts. We therefore choose to remand this case for the district court to consider whether the government had a reasonable opportunity to establish the cost of exempting Callahan. If it finds that the government passed up this opportunity, we direct the court to enter judgment for Callahan.
REVERSED and REMANDED.
. Chapter 13 of the New Testament Book of Revelation reads in part:
16. He [the beast] causeth all, both small and great, rich and poor, free and bond, to receive a mark in their right hand, or in their foreheads:
17. And that no man might buy or sell, save he that had the mark, or the name of the beast, or the number of his name;
18. Here is wisdom. Let him that hath understanding count the number of the beast: *1272for it is the number of a man; and his number is six hundred threescore and six.
. Because the federal government, through section 602(a)(25) of the Social Security Act, forces the State of California to require recipients to have SSNs before receiving aid, it is the federal government’s interest in the SSN requirement which we will consider.
. The affidavits suggest that the use of a computerized data system based on unique identifiers serves a variety of functions essential to the AFDC's operation. These functions include eligibility verification, proper check payment, avoidance of benefit duplication or overpayment, coordination of AFDC with other federal programs (Medicaid, WIN, Child Support Program) and the ability to exchange information with the states’ data processing systems.
. In New York in 1977 an individual holding the same religious belief as Callahan was permitted to receive AFDC benefits without obtaining SSNs for his four children. See Stevens v. Berger. None of the parties here addressed the costs incurred by the government after that case was decided.
. In Thomas, the Supreme Court gave no weight to the government’s mere speculation that other individuals with religious beliefs similar to Thomas’ would quit their jobs and seek unemployment benefits:
There is no evidence in the record to indicate that the number of people who find themselves in the predicament of choosing between benefits and religious beliefs is large enough to create 'widespread unemployment’ or even to seriously affect unemployment....
450 U.S. at 719, 101 S.Ct. at 1432. Similarly, we grant no weight to the government’s implication that many people may hold Callahan’s religious belief.