Appellant Carl Davis, Jr., appeals the Lincoln County Circuit Court's dismissal of his pro se petition for declaratory judgment and writ of mandamus. In his petition, Davis, an inmate incarcerated in the Arkansas Department of Correction (ADC), challenged the ADC's calculation of his parole eligibility. Davis alleged that the ADC incorrectly included certain felony convictions in its calculation of his multiple-offender classification. Based on the ADC's incorrect calculation, the ADC had determined that Davis was in his "fourth term" and classified him a fourth offender for purposes of parole eligibility. Additionally, Davis argued that including his 1981 convictions for burglary and robbery resulted in an ex post facto violation. The circuit court found that the ADC had not erred in its calculation as to either issue, and therefore, Davis had failed to state a claim on which relief could be granted. We agree that there has been no ex post facto violation, and we affirm on that issue. However, we do not agree that the perjury conviction should have been used in calculating Davis's status as a habitual offender, and we reverse and remand on that point.
In 1981, Davis entered negotiated guilty pleas in two cases in the Jefferson County Circuit Court, 35CR-81-321 and 35CR-81-330, on charges of burglary and robbery, which were both Class B felonies. In materials provided to Davis, the ADC counted this as Davis's first term of incarceration.
In 1983, when Davis had been released on parole, he was convicted and sentenced on two counts of burglary, which were Class B felonies, and two counts of theft of property, which were Class C felonies, in 35CR-83-137. The ADC counted this as Davis's second term of incarceration.
In 1985, while still incarcerated for the 1983 convictions, Davis entered a guilty *56plea to perjury, a Class C felony, in 35CR-85-270. Davis's sentence in that case was to be served concurrently to the one he was already serving, and because the term of the sentence for perjury was less than what remained on Davis's previous convictions, the conviction did not extend the aggregate term of his incarceration. The ADC counted this as Davis's third term of incarceration.
In 1991, after being released on parole for his previous charges, Davis was found guilty and sentenced on a charge of aggravated robbery in 35CR-91-457. Davis is currently incarcerated serving a seventy-year sentence on the 1991 aggravated-robbery conviction.
The ADC classified Davis as a fourth offender under Arkansas Code Annotated section 16-93-606(b)(4) (Repl. 2006) based on this calculation, and using that habitual-offender status, it determined that under Arkansas Code Annotated section 16-93-607(c)(5), Davis was not eligible for parole. The definition of a fourth offender in section 16-93-606(b)(4) is
an inmate convicted of four (4) or more felonies and who has been incarcerated in some correctional institution in the United States, whether local, state, or federal, three (3) or more times for a crime which was a felony under the laws of the jurisdiction in which the offender was incarcerated, prior to being sentenced to a correctional institution in this state for the offense or offenses for which he or she is being classified.
(Emphasis added.) Section (a) of the same statute defines the term "felony" as used in the section as "a crime classified as Class Y felony, Class A felony, or Class B felony by the laws of this state."
The circuit court considered exhibits outside the pleadings in making its ruling, and we treat the dismissal as one on summary judgment. Rogers v. Knight , 2017 Ark. 267, 527 S.W.3d 719. Summary judgment is appropriate when there are no genuine issues of material fact, and the moving party is entitled to judgment as a matter of law. Hotfoot Logistics, LLC v. Shipping Point Mktg., Inc. , 2013 Ark. 130, 426 S.W.3d 448.
Davis sought the appropriate remedy; a challenge to the ADC's interpretation of a statute and its application to calculate parole eligibility may support declaratory judgment. See, e.g. , Hobbs v. Baird , 2011 Ark. 261 (affirming grant of declaratory judgment where ADC had erroneously interpreted statute). The denial of a declaratory-judgment action is upheld unless the denial is clearly erroneous, with issues of statutory interpretation reviewed de novo. Haile v. Johnston , 2016 Ark. 52, 482 S.W.3d 323.
Here, the issue is whether the ADC correctly interpreted and applied the applicable parole-eligibility statutes. Parole eligibility is determined by the law in effect at the time the crime is committed. Bramlett v. Hobbs , 2015 Ark. 146, 463 S.W.3d 283. Here, it is Davis's eligibility for parole on the sentence for his 1991 aggravated-robbery conviction that is at issue. The judgment reflects that the offense in that case was committed on July 21, 1991, and the ADC must apply the method of classification described in Act 825 of the 1983 Acts of Arkansas, codified as Arkansas Code Annotated sections 16-93-605 to -607 (Repl. 2006).
First, Davis contends that application of Act 825 was error and that a previous statute should be applied. Specifically, Davis argues that application of Act 825 would result in an ex post facto violation because the crimes he committed in 35CR-81-321 and 35CR-81-330 occurred prior to the effective date of the Act. We have addressed this question before and determined *57that no ex post facto violation occurred.
Davis is charged with knowledge that if he committed an additional offense, his parole eligibility would be computed in accordance with the law in effect at the time his latest felony was committed. Woods v. Lockhart , 292 Ark. 37, 727 S.W.2d 849 (1987). There are two critical elements that must be present for a criminal law to be ex post facto: (1) it must be retrospective, that is, it must apply to events occurring before its enactment; (2) it must disadvantage the offender affected by it. Brown v. Lockhart , 288 Ark. 483, 707 S.W.2d 304 (1986). The application of Act 825 is to Davis's most recent conviction and not to the previous convictions used to determine his status as a repeat offender. Id. The circuit court correctly determined that Davis's ex post facto argument failed.
We now turn to Davis's argument that the ADC incorrectly included his conviction for perjury, a Class C felony, as one of his "terms" in calculating that he was a fourth offender. Davis argues that the term of incarceration for the Class C felony should not have been counted, and that it began while he was still incarcerated on the charges in 35CR-83-137. Davis would have the ADC count the convictions in the two cases as one "term" because he was not released prior to the commencement of the perjury "term."
In response, the ADC argues that Davis could be considered as incarcerated an additional period of confinement, even though he was still serving his term for the 1983 charges, citing Tisdale v. Lockhart , 288 Ark. 203, 703 S.W.2d 849 (1986). Tisdale interpreted two earlier parole acts and concerned the application of those acts to separate convictions. The ADC now asserts that the circuit court correctly concluded that the similar statute applicable here has no requirement that an inmate be incarcerated three or more separate times in order to be classified as a fourth offender, instead requiring only that the inmate has been convicted of four or more felonies and served terms of incarceration, concurrently or otherwise, on at least three of those felonies prior to the commission of the offense for which he is being evaluated.
The basic rule of statutory construction is to give effect to the intent of the legislature. State v. Colvin , 2013 Ark. 203, 427 S.W.3d 635. Penal statutes are to be strictly construed, and all doubts are to be resolved in favor of the defendant. Id. Nevertheless, even a penal statute must not be construed so strictly as to defeat the obvious intent of the legislature. Id. In construing any statute, we place it beside other statutes relevant to the subject matter in question and ascribe meaning and effect to be derived from the whole. Id.
As stated above, Arkansas Code Annotated section 16-93-606(a) defines the term "felony" as used in the section as "a crime classified as Class Y felony, Class A felony, or Class B felony by the laws of this state." Here, the felony at issue is Davis's conviction for perjury, a Class C felony. Based on the plain language used in section 16-93-606(a) to define "felony," the ADC incorrectly included Davis's perjury conviction in its calculation of Davis's status as a habitual offender. Stated differently, because Davis's perjury conviction was not a Class Y, A, or B felony, his Class C perjury conviction and term of incarceration should not have been included in the ADC's calculation of his status as a habitual offender.
Turning to the other convictions and terms of incarceration at issue, in 1981, Davis entered negotiated guilty pleas on two Class B felonies, for which Davis was sentenced to his first term of incarceration. In 1983, Davis was convicted of two *58Class B felonies, for which he was sentenced to his second term of incarceration. In 1991, Davis was convicted of one Class Y felony, for which he was sentenced to his third term of incarceration. Again, we note that Davis's perjury conviction was not a qualifying "felony" as contemplated by section 16-93-606. The requirements of fourth-offender status are twofold: (1) the inmate has been convicted of four (4) or more felonies and (2) the inmate has been incarcerated in some correctional institution in the United States, whether local, state, or federal, three (3) or more times for a crime which was a felony under the laws of the jurisdiction in which the offender was incarcerated, prior to being sentenced to a correctional institution in this state for the offense or offenses for which he or she is being classified. Ark. Code Ann. § 16-93-606(b)(4). Thus, when calculating Davis's prior convictions and commitments prior to the commission of the crime for which Davis was being classified-here, his 1991 aggravated-robbery conviction-Davis had been convicted of four prior "felonies." However, Davis had only served two prior terms of incarceration as contemplated by the statute. Thus, Davis fell within section 16-93-606(b)(3), which governs third offenders, and not section 16-93-606(b)(4). Accordingly, we reverse on this issue and remand for the circuit court to enter an order in compliance with this decision.
Affirmed in part; reversed and remanded in part.