
483 P.2d 818 (1971)
W.F. SCHROEDER and D.S. Denning, Jr., S. Ben Dunlap, Herbert W. Rettig, and Richard Rosenberry, Respondents,
v.
Elizabeth Rose SCHAEFER and Dennis Schaefer, Appellants.
Supreme Court of Oregon, In Banc.
Petition for Rehearing Filed December 28, 1970.
Decided April 21, 1971.
Former Opinion Filed December 9, 1970.
*819 W.S. Schroeder, D.S. Denning, Jr., Vale, S. Ben Dunlap, Herbert W. Rettig, and Richard Rosenberry, Caldwell, Idaho, for the petition.
Harold A. Fabre, and Fabre & Ehlers, Pendleton, contra.
Upon Respondents' Petition for Rehearing Filed December 28, 1970.
HOLMAN, Justice.
Plaintiffs filed a petition for rehearing. Among the points raised was a contention that, after refusing to enforce the written contract, this court erred in failing to determine the reasonable value of plaintiffs' services or, in the alternative, in not remanding the case to the trial court for that purpose. As a consequence of this contention, the court requested and received a response from the defendants to which plaintiffs replied.
The immediate problem is whether the pleadings and the proof are sufficient to put quantum meruit in issue. This court has many times held that an action on a specific contract is insufficient to support a determination of reasonable value. Bahler v. Fletcher, 91 Or.Adv.Sh. 21, 474 P.2d 329, 331 (1970); Flaherty v. Bookhultz et al., 207 Or. 462, 483, 291 P.2d 221, 297 P.2d 856 (1956); Williams v. Ledbetter, 132 Or. 145, 150, 285 P. 214 (1930).
However, we have come to the conclusion that the rule of Bahler, Flaherty, and Williams should be qualified. The purpose of pleadings is to give notice of the issues to be litigated so that appropriate defenses can be prepared. Therefore, in a situation in which no surprise or prejudice has been suffered by the opposing party, the unqualified and strict application of the rule in question would seem to be inappropriate. This view has been adopted by the courts of both Idaho and North Carolina. H.J. McNeel, Inc. v. Canyon County, 76 Idaho 74, 277 P.2d 554 (1954) and Martin Flying Service v. Martin, 233 N.C. 17, 62 S.E.2d 528, 530 (1950). In McNeel, the Idaho court said as follows:
"* * * Respondent contends that plaintiff having pleaded and prosecuted its action upon an express contract, cannot now on appeal urge a right to recover on implied contract.
"* * *
"* * * Where a plaintiff pleads an express contract, but by proof establishes facts sufficient to support only an implied contract, he may recover upon *820 the implied contract, in the absence of surprise or prejudice to the defense * *." 277 P.2d 554 at 556.
ORS 16.660, which is made applicable to both suits[1] and actions, militates toward the same rule in Oregon. The statute provides:
"The court shall, in every stage of an action, disregard any error or defect in the pleadings or proceedings which does not affect the substantial rights of the adverse party."
The defendants were not taken by surprise. In discussing the admissibility of evidence, defendants' attorney made the following statement to the trial court:
"I think if the Court reaches the point where it determines this on a quantum merit [sic] basis then I think this is an important fact to determine in the overall picture. I will put it that way."
Defendants' attorney, in cross-examining one of the plaintiffs, also stated as follows:
"Q You understand that his Honor may reach a point where he is going to put a value on your services on a quantum merit [sic] basis?
"A Yes.
"Q And on that basis what do you think your time is worth?
"A Quantum merit [sic] basis?
"Q Yes.
"THE COURT: Do you mean on an hourly basis?
"BY MR. FABRE: (Continuing) Q On hourly basis, yes, sir.
"A We would try to get $30 per hour."
In addition, defendants used about six pages in their brief contending that the proof was insufficient to sustain a cause of action in quantum meruit for more than $7,500. Both parties put on expert testimony in addition to that quoted relative to the reasonable value of the services. The extent of services performed and the time involved were delved into minutely.
Defendants contend in their brief that the circumstances surrounding the execution of the express written contract should prevent plaintiffs from receiving any fee at all. They rely on the following language from 7 Am.Jur.2d Attorneys at Law § 219:
"A lawyer who does not at all times represent his client with undivided fidelity is not entitled to compensation for his services, even though his conduct was not intentionally prejudicial to his client's interest. An attorney who is guilty of actual fraud or bad faith toward his client, or who seeks to secure his personal advantage to the prejudice of his client, is not entitled to any compensation for his services. And a client may show as a defense to a claim for compensation that the attorney's services were worthless because of ignorance or negligence, although it should be remembered that an attorney is not an insurer of the result in a case in which he is employed unless he makes a special contract to that effect." (Footnotes omitted.)
We believe that this language is not applicable to the facts of the present case. The litigation was prosecuted with fidelity. Defendants received skilled, valuable, and successful services for which they should pay a reasonable fee. The purpose of quantum meruit is to prevent unjust enrichment at the expense of another.
Because the quantum meruit issue has been fully litigated and the testimony is all in the record, we see no purpose to be served by further litigation. Therefore, we proposed to dispose of the matter. Plaintiffs' testimony indicates that they devoted 586.18 hours of work to the Schaefer litigation. This testimony is attacked by defendants, who contend that some of the time was duplicated where two plaintiffs charged for doing the same thing at the same time. Defendants also claim that in *821 some circumstances the time charged was excessive.
In some instances, defendants' complaints are justified and in others they are not. Although there is some distortion in the number of hours, we do not believe it to be large. We conclude that the legitimate number of hours involved in the litigation of the two cases for which a charge could be made was approximately five hundred. At $30 an hour, this would justify a fee of $15,000. However, there is another factor which should be considered, and that is the seriousness of the litigation as reflected by the amount of money involved. The ownership of five-sixths of $125,100 worth of real property was being decided. Having concluded that the number of hours expended by plaintiffs was substantially five hundred, and taking into consideration the value of the property involved, we believe a reasonable fee to be $20,000.
The judgment of the trial court and the prior opinion of this court are modified and the case is remanded to the trial court with directions to enter a judgment for plaintiffs in the sum of $20,000. Costs on appeal are awarded to the defendants.
NOTES
[1]  See ORS 16.010.
