
701 P.2d 1381 (1985)
A. Kendrick SMITH; Max A. Hansen, and W.G. Gilbert, Jr., Plaintiffs and Respondents,
v.
Clinton L. HOWERY and Jacqueline J. Howery, Defendants and Appellants.
No. 84-539.
Supreme Court of Montana.
Submitted on Briefs May 9, 1985.
Decided July 2, 1985.
*1382 Robert T. Cummins, Helena, for defendants and appellants.
Schulz, Davis & Warren, Dillon, Garlington, Lohn & Robinson, Missoula, for plaintiffs and respondents.
MORRISON, Justice.
Clinton and Jacqueline Howery (Howerys) appeal the May 14, 1984, order of the Fifth Judicial District Court granting respondent attorneys, Kendrick Smith, Max Hansen and W.G. Gilbert, Jr.'s motion for summary judgment. We affirm the order granting summary judgment.
In February of 1979, the State of Montana filed an action in Beaverhead County seeking to condemn .76 of an acre of Howerys' land for highway purposes. The State and Howerys were unable to agree on compensation. The Howerys therefore hired the respondents to represent them in the condemnation action.
The written retainer agreement executed by Howerys on March 21, 1979, contains the following provisions regarding costs and attorneys fees:
"1. You are to pay us all of our reasonable expenses which we will try to keep to a minimum, and these will be payable to us, no matter what the outcome of the case... .
"2. The fees for our services will be on a contingent fee basis, and you have agreed to pay us 331/3% of the recovery by judgment or compromise (and you would have to fully agree to any compromise before it would be effective). In the event there is an appeal in the case by either side, the fee would be raised to 40% of the amount of recovery. There will be only one fee as between the two law firms."
The Howerys recovered $315,284.03 from the State: $243,475.00 for total damages; $42,958.33 for interest on those damages from the date of taking; and $28,850.70 for costs and attorneys' fees. The State paid the entire judgment prior to appealing to this Court. We affirmed that judgment in State of Montana v. Howery (Mont. 1983), 664 P.2d 1387, 40 St.Rep. 975. Howerys were further awarded $8,427.19, $8,220.00 of which was attorneys' fees, for the State's appeal.
While the appeal was pending in this Court, $303,109.03 of the $315,284.03 was placed in three certificates of deposit jointly held in the names of attorney Max Hansen and the Howerys. The remaining $12,175.00 was paid directly to respondent attorneys for their costs and witness fees. The certificates of deposit earned post-judgment interest totalling $40,458.38.
Following the State's unsuccessful appeal, the Howerys and respondents began negotiations to settle the attorneys' fees due and owing to the respondents. The parties were unable to reach agreement and respondents filed a complaint July 26, 1983, seeking $143,329.68 for work performed and services rendered. An amended complaint seeking the same amount was filed the next day.
Permission to file a second amended complaint was granted respondents on October 24, 1983. That complaint reduced the demand for attorneys' fees to $130,717.60 and added a second count, alleging a breach by Howerys of an implied covenant of fair *1383 dealing with the attorneys and requesting exemplary damages of $50,000.00.
On November 18, 1983, Howerys filed an answer, counterclaim and demand for jury trial. Howerys summarily denied all the allegations contained in each count of respondents' complaint. Their counterclaim alleged, among other things, a breach of the attorneys' obligation to deal fairly with them and violation of the fiduciary relationship between Howerys and the attorneys.
On January 16, 1984, respondents filed a motion for summary judgment on Count I of the second amended complaint. The motion was accompanied by an affidavit of attorney Max Hansen setting forth pertinent details and requesting $129,866.34 for work performed and services rendered pursuant to respondents' contract with Howerys. Clinton Howery filed an affidavit in opposition to the motion for summary judgment on February 6, 1984.
A hearing was held May 4, 1984, and an order granting respondents' motion for summary judgment was issued May 16, 1984. The trial judge awarded respondents $129,866.34, stating that no affirmative defense to Count I had been pled, and, that:
"Count I is based upon a written agreement between the parties, a Judgment rendered by the District Court of the Fifth Judicial District of the State of Montana and an affirmance by the Montana Supreme Court, all of which are clear, certain and unambiguous. No extrinsic or parol evidence is needed or admissible to explain any of the clear terms and provisions of the written agreement. There are no genuine issues as to any material facts, and it is the duty of this Court to apply the language of the agreement as written. The amount due and owing from defendants to plaintiffs is fixed and is not ambiguous in any way... ."
Count II of respondent's complaint and Howerys' counterclaim are still pending.
Following a Rule 54(b), M.R.Civ.P., certification, Howerys filed this appeal, raising the following issue:
"Whether the District Court erred in granting the plaintiffs' motion for summary judgment on Count I of the second amended complaint and determining under Rule 56(c), M.R.Civ.P., that the plaintiffs showed that there was no genuine issue as to any material fact and that they were entitled to judgment as a matter of law?"
A motion for summary judgment should be granted "if the pleadings, depositions, answers to interrogatories, and admissions on file, together with the affidavits, if any, show that there is no genuine issue as to any material fact and that the moving party is entitled to a judgment as a matter of law." Rule 56(c), M.R.Civ.P. We have frequently stated the rule:
"It is well established that a party moving for summary judgment has the burden of showing a complete absence of any genuine issue as to all facts deemed material in light of the substantive principles that entitle that party to a judgment as a matter of law. (citations omitted) ..." Cereck v. Albertson's Inc. (1981), 195 Mont. 409, 411, 637 P.2d 509, 511.
We agree with the determination of the trial court that respondents have met this burden.
The contract between the parties is clear and unambiguous. It mandates that respondents shall receive 40% of any recovery on appeal. When an attorney enters into a contingent fee arrangement based on a percentage of the judgment or award recovered by the client and the total amount recovered includes interest, the attorney is entitled not only to a percentage of the actual damages recovered, but also to a percentage of the pre-judgment and post-judgment interest recovered. See In re Edgecombe Road (1908), 128 App.Div. 432, 112 N.Y.S. 845, regarding pre-judgment interest and Matter of Innkeepers of New Castle, Inc. (7th Cir.1982), 671 F.2d 221, regarding post-judgment interest.
Respondent Max Hansen's affidavit requesting $129,866.34 is consistent with the contract between respondents and *1384 Howerys and with the law. The $129,866.34 represents 40% of the actual damages ($243,475 X 40 = $97,390) and 40% of the pre-judgment interest ($42,958.33 X .40 = $17,183.33) or $114,573.33, together with 37.79937% of the post-judgment interest ($40,458.38 X.3779937 = $15,293.01). Respondents were properly awarded 37.79937% of the post-judgment interest because only 37.79937% of the money deposited in the certificates of deposit was theirs ($114,573.33/$303,109.03 = 37.79937%).
The amounts previously requested by respondents resulted from improper calculations and not from an ambiguous contract, as Howerys contend. The initial request was for 40% of the entire award, costs and interest. That request failed to consider that respondents had already been directly paid their actual costs, pursuant to the contract. The amount requested in the second amended complaint failed to consider that only 37.79973% of the money in the certificates of deposit belonged to respondents. The contract is clear. The respondents are entitled to $129,866.34.
Next, the Howerys allege that their counterclaim should also be treated as an affirmative defense to the allegations in Count I of respondents' complaint and that the counterclaim, when treated as an affirmative defense, raises issues of material fact, thus foreclosing a summary judgment determination. We agree that under our liberal pleading rules, the counterclaim can be treated as an affirmative defense. Rule 8(c), M.R.Civ.P. However, the counterclaim/affirmative defense does not foreclose a summary judgment determination on Count I.
The primary allegations contained within the counterclaim involve the breach of the fiduciary relationship between the attorneys and their clients and the breach of the obligation of good faith and fair dealing owed by the attorneys to their clients. These allegations are separate and distinct from the present issue, whether the attorneys' fees contract is clear and unambiguous.
Finally, we will not consider Howerys' contention that the contract does not reflect the terms mutually agreed upon by the parties as that allegation depends entirely on evidence extrinsic to the contract.
"`The principle is well-established and of general application, subject to certain exceptions, that when a contract has been reduced to writing the contents of such writing cannot be added to, contradicted, altered, or varied by parol or extrinsic evidence, and that such writing supersedes all oral negotiations concerning its matter which preceded, accompanied, or led up to its execution. This was the rule at common law, and has been embodied in the statute law of this state.' (Emphasis in original.)
"Section 28-2-905, MCA, provides that when the terms of an agreement have been reduced to writing by the parties, it is to be considered as containing all the terms, and there can be no evidence of the terms of the agreement other than the contents of the writing except when a mistake or an imperfection of the writing, is at issue, or when the validity of the agreement is the fact in dispute." Perez-Lizano v. Ayers (Mont. 1985), 695 P.2d 467, 470, 42 St.Rep. 208, 212-213, citing West River Equipment Co. v. Holzworth Construction Co. (1959), 134 Mont. 582, 588, 335 P.2d 298, 302.
The decision of the trial court judge is affirmed.
TURNAGE, C.J., and HARRISON, WEBER, SHEEHY, GULBRANDSON and HUNT, JJ., concur.
