#include <bits/stdc++.h>
using namespace std;

int main() 
{
    int n;
    cin>>n;

    int b[n+1]; // 1 - based indexing 
    for(int i=1; i<=n; i++)
    {
        cin>>b[i];
    }

    int k;
    cin>>k;

    int count = 0;
    int c = 0;
    for(int i=1; i<=n; i++)
    {
        if( i>=2 && (b[i] > b[i-1]))
        {
            c = c + 1; // Increment 'c' and you will be knowing the size of the island 
        }
        else
        {
            // now you know the size of previous island which is 'c'
            int actual = c + 1;

            if(actual>=k && k>=2)
            {
                count = count + (actual - k )  + 1;
            }
            c = 0;
        }
    }

    // now to take care of the last island 
    // ------------------- same here the above else condition logic copy paste here
    int actual = c + 1;
    if(actual>=k && k>=2)
    {
        count = count + (actual - k)  + 1 ;
    }
    //------------------------------------------

    if(k==1) // means the single element is subarrray  so print n 
    {
        cout<<n;
    }
    else// if k is not 1
    {
        cout<<count; // then print the count 
    }

    

    

    return 0;
}