//Dan Holycross

//Midland High

//Senior 3

#include <iostream>

using namespace std;

class slot{

public:

            bool mainlv, highlv;

            slot* next;

            slot(){

                        mainlv=false;

                        highlv=false;

                        next=NULL;

            }

            int move(bool ten){

                        if(!ten){

                                    if(mainlv && !next->mainlv){

                                                mainlv=false;

                                                next->mainlv=true;

                                                return 2;

                                    }

                                    else if(mainlv && next->mainlv && !highlv){

                                                mainlv=false;

                                                highlv=true;

                                                return 1;

                                    }

                                    else if(!mainlv && highlv){

                                                mainlv=true;

                                                highlv=false;

                                                return 1;

                                    }

                                    else return 1;

                        }

                        else{

                                    if(mainlv && !highlv){

                                                mainlv=false;

                                                highlv=true;

                                                return 1;

                                    }

                                    else if(!mainlv && highlv){

                                                mainlv=true;

                                                highlv=false;

                                                return 1;

                                    }

                                    else return 1;

                        }

            }

};

int main(){

            slot stage[10];

            for(int i=0;i<9;i++){

                        stage[i].next=&stage[i+1];

            }

            int birds, end;

            cin>>birds;

            for(int i=0;i<birds;i++){

                        int temp;

                        cin>>temp;

                        stage[temp-1].mainlv=true;

            }

            cin>>end;

            for(int i=0;i<end-1;i++){

                        int start=0, end=10;

                        if((!stage[0].mainlv) && stage[9].mainlv){

                                    stage[0].mainlv=true;

                                    stage[9].mainlv=false;

                                    start=1;

                                    end=9;

                        }

                        for(int j=start;j<end;j+=stage[j].move(j==9));

            }

            int total=0;

            for(int i=0;i<10;i++) {

                        if(stage[i].mainlv){

                                    total++;

                        }

            }

            cout<<total<<'\n';

            system("pause");

            return 0;

}