The plaintiffs, Gary and Roberta Watros, filed a complaint in the Superior Court seeking review of a decision by the board of appeals of Winchester (board) granting a special permit to the defendant, Greater Lynn Mental Health and Retardation Association, Inc. (GLM-HRA), to renovate and to use a barn located on land owned by the defendants Emanuel and Barbara Miliaras in order to provide shelter and education for up to three mentally handicapped adults. The plaintiffs own, and reside on, property abutting that of the Miliar oses. The defendant board and the plaintiffs filed motions for summary judgment and the defendant GLMHRA filed a motion, pursuant to Mass. R. Civ. P. 12 (b) (1), 365 Mass. 754 (1974), to dismiss the plaintiffs’ complaint for lack of subject matter jurisdiction. A judge denied GLMHRA’s motion to dismiss and the board’s motion for summary judgment and, in response to the plaintiffs’ motion for summary judgment, ordered judgment “annul[ling] the board’s decision and revoking] the special permit.”
GLMHRA appealed. The Appeals Court reversed the judgment without reaching the underlying merits of the case. Instead, the court concluded that the plaintiffs lacked standing to obtain judicial review of the zoning decision. Watros v. Greater Lynn Mental Health & Retardation Assoc., Inc., 37 Mass. App. Ct. 657, 666-667 (1994). A court has jurisdiction to consider a zoning appeal only if it has been brought by a person with “standing,” that is, by a person who has been “aggrieved” by a board’s decision. G. L. c. 40A, § 17. Green v. Board of Appeals of Provincetown, 404 Mass. 571, 574 (1989). Barvenik v. Aldermen of Newton, 33 Mass. App. Ct. 129, 131 (1992). The Appeals Court reasoned that GLMHRA’s motion to dismiss was an “erroneously labelled” motion for summary judgment because GLMHRA “pre*108sented matters outside the pleadings” which were “not excluded by the court” and which the judge considered in connection with her ruling on the several motions before her including the motion to dismiss. Watros, supra at 662. Treating the motion to dismiss as a motion for summary judgment, the Appeals Court reasoned that the plaintiffs’ “presumptive standing as abutters receded and their burden of going forward on standing sprang up when their unsworn complaint assertions as to aggrievement were directly challenged by the denials and affirmative defenses in the defendants’ answers.” Id. at 666. The court concluded that the plaintiffs failed to carry that burden, id., and accordingly ordered that “the judgments denying GLMHRA’s motion to dismiss and granting summary judgment in favor of the Watroses [plaintiffs] are reversed; and a new judgment is to be entered dismissing the Watroses’ complaint.” Id. at 667. We allowed the plaintiffs’ application for further appellate review. We conclude that the plaintiffs had standing to seek judicial review of the board’s decision, but that the board did not exceed its authority. The board’s decision to grant GLM-HRA a special permit is affirmed.
Before reaching the principal issue on appeal, we pause to discuss a matter which, although not critical to the disposition of this case, seems to us to require discussion. In our view, GLMHRA’s motion to dismiss was not “erroneously labelled” as the Appeals Court’s opinion states, and the judge’s consideration of materials outside the pleadings did not require that the motion be treated as a motion for summary judgment. Rule 12 (b) of the Massachusetts Rules of Civil Procedure, 365 Mass. 754 (1974), provides in relevant part that “[e]very defense, in law or fact, to a claim for relief in any pleading . . . shall be asserted in the responsive pleading thereto if one is required, except that the following defenses may at the option of the pleader be made by motion: (1) Lack of jurisdiction over the subject matter; . . . (6) Failure to state a claim upon which relief can be granted. ... If, on any motion asserting the defense numbered (6), to dismiss for failure of the pleading to state a *109claim upon which relief can be granted, matters outside the pleading are presented to and not excluded by the court, the motion shall be treated as one for summary judgment and disposed of as provided in Rule 56 [Mass. R. Civ. P. 56, 365 Mass. 824 (1974)], and all parties shall be given reasonable opportunity to present all material made pertinent to such a motion by Rule 56.” Under rule 12 (b), only a motion under subsection (b) (6) shall be treated as one for summary judgment as a result of the presentation of matters being presented by a party and not excluded by the court. The motion to dismiss in this case was made pursuant to rule 12 (b) (1), not 12 (b) (6), and therefore the presentation of, and failure to exclude, those materials did not require that the motion be treated as a rule 56 summary judgment motion.
We turn to the question whether the plaintiffs were “aggrieved persons” within the meaning of G. L. c. 40A, § 17, so that the Superior Court had subject matter jurisdiction. The judge, unlike the Appeals Court, determined that the plaintiffs were aggrieved persons and that, therefore, they had standing to challenge the board’s decision. We agree. The following facts appear to be uncontroverted. Emanuel and Barbara Miliaras own property in Winchester at 12-14 Mount Pleasant Street in a single residence zoning district. GLMHRA is a private, nonprofit educational foundation, organized under G. L. c. 180, to engage in, among other things, educational activities. GLMHRA applied for a building permit and zoning compliance certificate to renovate a barn owned by the Miliarases. The barn, an existing nonconforming accessory building, was to be used to provide shelter and education for three mentally handicapped individuals and their caretakers. A five-year lease between the Miliarases and GLMHRA, effective as of July 1, 1991, was signed by the parties on January 2, 1992.
The barn is situated at the rear of the Miliarases’ 18,503 square foot lot which also contains a twenty-room two-family residential dwelling situated at the front. The house contains two distinct dwelling units, one of which is occupied by the Miliarases, the other of which is rented to tenants. At the *110time of GLMHRA’s application for the permit, the barn was in disrepair and, since 1962, had been used exclusively for storage.
On August 26, 1991, Winchester’s building commissioner refused to issue GLMHRA the requested building permit and zoning compliance certificate on the ground that to do so would violate the zoning by-laws. GLMHRA appealed to the Winchester board of appeals under § 8.8 of the zoning bylaw. At the same time, GLMHRA filed an application for a special permit for the proposed use.
The plaintiffs own and reside at 10 Mount Pleasant Street on property which abuts the Miliarases’ property. As abutters and, therefore, parties in interest, the Watroses received notice of GLMHRA’s request for a special permit pursuant to G. L. c. 40A, §§ 11 and 15.
On January 2, 1992, the board granted a special permit to GLMHRA to utilize the barn as a home for mentally handicapped persons. The board found that “the change, extension or alteration to the nonconforming structure is equally or more appropriate to the neighborhood than the existing structure, that the special permit would comply with all other provisions of this By-law and would not adversely affect the public health, safety, welfare, comfort or convenience of the community; and that satisfactory arrangements [had] been made for ingress and egress from the property and proposed structures, off-street parking areas, refuse collection or disposal and service areas, screening and buffering, signs, required yards and other open space, and general compatibility with adjacent properties and other property in the district.”
General Laws c. 40A, § 15, provides that the board of appeals must hold a hearing on any appeal and must “cause notice of such hearing to be published and sent to parties in interest as provided in section eleven.” Section 15 also provides that “notice of the decision shall be mailed forthwith to the petitioner, applicant or appellant, to the parties in interest designated in section eleven,” and to others. General Laws c. 40A, § 11, states: “‘Parties in interest’ as used in *111this chapter shall mean the petitioner, abutters,” and others. Thus, by statute, the plaintiffs, who were abutters to the land in question, were entitled to notice of the hearing before the board and notice of its decision. There is a presumption, therefore, that the plaintiffs were aggrieved parties within the meaning of G. L. c. 40A, § 17, and therefore had standing to bring this action. See Marotta v. Board of Appeals of Revere, 336 Mass. 199, 204 (1958); Barvenik v. Aldermen of Newton, 33 Mass. App. Ct. 129, 131 (1992); Gordon v. Zoning Bd. of Appeals of Lee, 22 Mass. App. Ct. 343, 347 (1986).
The aforementioned presumption is rebuttable, however. The presumption recedes when a defendant challenges a plaintiff’s status as an aggrieved person and offers evidence supporting his or her challenge. See Barvenik, supra at 131 & n.7 (the presumption of aggrievement is destroyed upon the defendant’s offer of evidence warranting a finding contrary to the presumed fact). See also Marotta, supra at 204. In this case, no evidence was presented at the hearing that controverted the plaintiffs’ presumption of standing. The findings of the board, resulting in the decision that the plaintiffs are challenging, cannot be given evidentiary weight. Josephs v. Board of Appeals of Brookline, 362 Mass. 290, 295 (1972). Marotta, supra at 201. Therefore, the plaintiffs were entitled to rely entirely on their presumed status of being aggrieved parties. See Rafferty v. Sancta Maria Hosp., 5 Mass. App. Ct. 624, 629 (1977).
Our determination that the plaintiffs are aggrieved persons and that, therefore, the Superior Court had jurisdiction to review the board’s decision to grant GLMHRA a special permit, brings us to the second issue presented by this appeal# which is whether the board’s decision exceeded its authority and for that reason was invalid. We hold that the decision was within the board’s authority and was valid. We reverse the judgment entered in the Superior Court.
General Laws c. 40A, § 3, second par., inserted by St. 1975, c. 808, § 3 (commonly referred to as the Dover Amendment), provides, in part, as follows:
*112“No zoning ordinance or by-law shall . . . prohibit, regulate or restrict the use of land or structures for religious purposes or for educational purposes on land owned or leased by the commonwealth or any of its agencies, subdivisions or bodies politic or by a religious sect or denomination, or by a nonprofit educational corporation; provided, however, that such land or structures may be subject to reasonable regulations concerning the bulk and height of structures and determining yard sizes, lot area, setbacks, open space, parking and building coverage requirements.”
We agree with the Superior Court judge’s statements in her memorandum of decision that “[tjhere is no doubt that GLMH[RA] is a ‘non-profit educational corporation’ ” and that “[t]he defendants have accurately referenced case law to support their contention that GLMH[RA]’s proposed use of the barn is considered educational for purposes of the statute. See Campbell v. City Council of Lynn, 32 Mass. App. Ct. 152, 154-155 (1992).” Nevertheless, the judge concluded that GLMHRA was not entitled to the protection of G. L. c. 40A, § 3, because it had leased only a single, accessory structure on the Miliarases’ property rather than the entire lot. The judge reasoned as follows:
“The two-family dwelling unit is a pre-existing nonconforming use. The barn is a pre-existing nonconforming accessory structure which has been used for the past thirty years for storage. The proposed use by GLMH[RA] would convert a storage building to another dwelling unit. This conversion would greatly intensify the nonconforming use which presently exists on the locus and essentially allow three residential dwellings on a piece of property which is zoned for only one residence. Section 3 of chapter 40A, was never intended to provide for such a result. ... By GLMH[RA]’s leasing of just the Miliaras barn, and not the whole lot upon which it is situated, GLMH[RA] subjects itself to *113the Town’s zoning by-laws which regulate such nonconforming structures.”
The judge reiterated the thrust of her holding in a footnote, stating that “if GLMH[RA] was leasing the entire parcel of land owned by Miliaras and proposed to use the two-family residential dwelling for the aforementioned educational purposes, it is quite clear that the Town, under the provisions of Chapter 40A, Section 3, would be precluded from prohibiting such use.”
No authority supporting the judge’s conclusion has been brought to our attention. The plaintiffs argue, however, that that conclusion finds support in a literal reading of G. L. c. 40A, § 3. We do not agree that, read literally, the statute says that, for the educational use of a structure leased to a nonprofit educational corporation to be protected, the entire lot must be owned by or leased to that corporation. In any event, it is a well-established canon of statutory construction that a strictly literal reading of a statute should not be adopted if the result will be to thwart or hamper the accomplishment of the statute’s obvious purpose, and if another construction which would avoid this undesirable result is possible. Industrial Tech. Sch., Inc. v. Commissioner of Educ., 330 Mass. 622, 627 (1953). Commissioner of Corps. & Taxation v. Boston Ins. Co., 328 Mass. 641, 646 (1952). Frye v. School Comm. of Leicester, 300 Mass. 537, 538 (1938). General Laws c. 40A, § 3, speaks not once, but twice, of “land or structures” as the focus of the exemption. Thus, “[n]o zoning . . . by-law shall . . . regulate or restrict the use of land or structures for . . . educational purposes . . . ; provided, however, that such land or structures may be subject to reasonable regulation . . . .” (Emphasis added.) G. L. c. 40A, § 3. No distinction is made by the statute regarding its applicability to “principal” or “accessory” buildings, and it is clear that the over-all intent of the Legislature was to prevent local interference with the use of real property for educational purposes. If we were to construe G. L. c. 40A, § 3, as the plaintiffs argue we should, a *114nonprofit educational corporation could be prevented by zoning restrictions from leasing a suite of rooms for an educational purpose within a larger building. Only those nonprofit educational corporations with sufficient financial resources to lease or purchase an entire property would enjoy the protection of G. L. c. 40A, § 3. Such a constrictive result is neither required by the language of the statute nor consistent with its purpose.
The plaintiffs contend that G. L. c. 40A, § 6, which regulates the extension or alteration of preexisting nonconforming structures or uses, supports the proposition that c. 40A, § 3, requires ownership of, or a leasehold interest in, an entire lot. Section 6 provides:
“Pre-existing, nonconforming structures or uses may be extended or altered, provided, that no such extension or alteration shall be permitted unless there is a finding by the permit granting authority or by the special permit granting authority designated by ordinance or bylaw that such change, extension or alteration shall not be substantially more detrimental than the existing, nonconforming use to the neighborhood.”3
The plaintiffs argue substantially as follows: If the special permit is granted, thereby allowing GLMHRA to lease only a portion of the Miliarases’ property, the premises will include the presently existing two-family house located at the front of the property plus a third residential unit (the barn). This would (the plaintiffs say) substantially increase the lot’s nonconformity, to the plaintiffs’ detriment, and it would vio*115late G. L. c. 40A, § 6.4 According to the plaintiffs, to hold that G. L. c. 40A, § 3, nevertheless entitles GLMHRA to the special permit would mean that § 3 supersedes § 6, which is untenable.
The plaintiffs argue that §§ 3 and 6 can only be construed harmoniously if § 3 is construed as requiring GLMHRA to lease the entire property for its educational purpose if it is to get the benefit of § 3. If GLMHRA were to do so, the plaintiffs say, the present nonconforming use (two residential units) would be replaced by another use (educational) of no greater intensity and § 6 would simply be inapplicable.
We are not persuaded. Permitting GLMHRA to use the barn for an educational purpose neither permits nor expands a nonconforming use. GLMHRA’s proposed use of the barn as a residence for three mentally handicapped adults is a protected use for an educational purpose within the meaning of G. L. c. 40A, § 3. The proposed use does not violate any restriction of the local zoning laws, because, by virtue of § 3, local officials cannot apply a local zoning law to deny GLM-HRA the right to use the property for its educational purpose. See Campbell v. City Council of Lynn, 415 Mass. 772, 777 n.6 (1993). A nonconforming use, on the other hand, is a use which is excused from complying with a local zoning law because it was in existence prior to the enactment of the law. Id. Thus, it rightly cannot be said that GLMHRA’s proposed educational use is a nonconforming use. Hence, contrary to the plaintiffs’ contention, GLMHRA’s proposed use of the barn for educational purposes would not increase a nonconforming use of the premises.
We conclude that the Superior Court judge was correct in holding that the plaintiffs had standing to bring this action and, accordingly, that the Superior Court had jurisdiction. However, we do not agree with the judge that GLMHRA was not entitled to the protection of G. L. c. 40A, § 3. The board’s decision to grant GLMHRA the special permit was *116not in excess of the board’s authority. Therefore, it was valid. The judgment of the Superior Court is reversed and the decision of the Winchester board of appeals is affirmed.
So ordered.
The concluding portion of the quoted provision must be read as follows: “shall not be substantially more detrimental than the existing, nonconforming structure or use to the neighborhood” (emphasis added). Willard v. Board of Appeals of Orleans, 25 Mass. App. Ct. 15, 21 (1987). This statute presents “one of those rare instances in which a court must overcome its reluctance to supply a word or words which were not employed by the Legislature (see, e.g., Murray v. Board of Appeals of Barnstable, 22 Mass. App. Ct. 473, 479 [1986]) in order to render a statute intelligible and so effectuate its obvious intent.” Id.
The plaintiffs do not argue that the proposed educational use of the barn would result in a violation of Winchester’s lot area requirements.