// if you get a wrong answer but you are convinced
// that your logic is correct do :- 1) read the
// entire code and try to find if something needs
// to be added 2) start making test cases that you
// think can possibly give WA.
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <vector>
#include <string>
using namespace std;
typedef double  dbl;
typedef long long int lld;
#define PI 3.14159265358979323
#define foi(i,n) for(lld i = 0; i < n; i+=1)
#define fod(i,n) for(lld i=n-1; i >=0; i-=1)
#define MAX std::numeric_limits<lld>::max()
#define MIN std::numeric_limits<lld>::min()
#define FastIO  ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define LEN 200005
lld A[LEN];
lld B[LEN];
int main ()
{
      #ifndef ONLINE_JUDGE
      freopen("inputf.in",  "r",  stdin);
      freopen("outputf.in", "w", stdout);
      #endif
      FastIO
      string a;
      string b;
      cin >> a >> b;
      lld len_a = a.size(), len_b = b.size();
      for(lld i = 0; i < len_a; i += 1)
      	A[i] = (lld)a[i]-48;
      for(lld i = 0; i < len_b; i += 1)
      	B[i] = (lld)b[i]-48;
      if (len_a == len_b){
      	lld c = 0;
      	for(lld i = 0; i < len_b; i += 1){
      		if (A[i] != B[i])
      			c++;
      	}
      	cout<< c;
      	return 0;
      }
      if (len_b < (2*len_a)){
      	lld z = 0, o = 0;
      	lld cnt[len_b];
      	for(lld i = 0; i < len_b-len_a+1; i += 1){
      		if (A[i] == 0)
      			z++;
      		if (A[i] == 1)
      			o++;
      		if (B[i] == 0) cnt[i] = o;
      		else cnt[i] = z;
      	}
      	lld j = 0;
      	for(lld i = len_b-len_a+1; i < len_b; i += 1){
      		if (A[j] == 0)
      			z--;
      		if (A[j] == 1)
      			o--;
      		j++;
      		if (i < len_a){
      			if (A[i] == 0)
      				z++;
      			if (A[i] == 1)
      				o++;
      			if (B[i] == 0) cnt[i] = o;
      			else cnt[i] = z;
      		}
      		else{
      			if (B[i] == 0) cnt[i] = o;
      			else cnt[i] = z;
      		}
      	}
      	lld sum = 0;
      	for(lld i = 0; i < len_b; i += 1)
      		sum += cnt[i];
      	cout << sum;
      	return 0;
      }
      lld zero[len_a], one[len_a];
      lld z = 0;
      lld o = 0;
      for(lld i = 0; i < len_a; i += 1){
      	if (A[i] == 0)
      		z++;
      	if (A[i] == 1)
      		o++;
      	zero[i] = z;
      	one [i] = o;
      }
      lld cnt[len_b];
      for(lld i = 0; i < len_b-len_a+1;  i += 1){
      	if (i < len_a){
      		if (B[i] == 0) cnt[i] = one[i];
      		else cnt[i] = zero[i];
      	}
      	else{
      		if (B[i] == 0) cnt[i] = one[len_a-1];
      		else cnt[i] = zero[len_a-1];
      	}
      }
      lld j = len_a-1;
      lld z1 = 0, o1 = 0;
      for(lld i = len_b-1; i >= len_b-len_a+1; i -= 1){
      	if (A[j] == 0)
      		z1++;
      	if (A[j] == 1)
      		o1++;
      	if (B[i] == 0) cnt[i] = o1;
      	else cnt[i] = z1;
      	j--;
      }

      lld sum = 0;
       for(lld i = 0; i < len_b; i += 1)
       	sum += cnt[i];
       cout << sum;
      return 0;
}


// if you get a wrong answer but you are convinced
// that your logic is correct do :- 1) read the
// entire code and try to find if something needs
// to be added 2) start making test cases that you
// think can possibly give WA.
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <vector>
#include <string>
using namespace std;
typedef double  dbl;
typedef long long int lld;
#define PI 3.14159265358979323
#define foi(i,n) for(lld i = 0; i < n; i+=1)
#define fod(i,n) for(lld i=n-1; i >=0; i-=1)
#define MAX std::numeric_limits<lld>::max()
#define MIN std::numeric_limits<lld>::min()
#define FastIO  ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define LEN 200005
lld A[LEN];
lld B[LEN];
lld check (lld l, lld r, lld offset)
{
	if (l ==r){
		return (B[l] xor A[l-offset]);
	}
	if (l < r){
		lld mid = (l+r)/2;
		return (check(l,mid,offset)+check(mid+1,r,offset));
	}
}
int main ()
{
      #ifndef ONLINE_JUDGE
      freopen("inputf.in",  "r",  stdin);
      freopen("outputf.in", "w", stdout);
      #endif
      FastIO
      string a;
      string b;
      cin >> a >> b;
      lld len_a = a.size(), len_b = b.size();
      for(lld i = 0; i < len_a; i += 1)
      	A[i] = (lld)a[i]-48;
      for(lld i = 0; i < len_b; i += 1)
      	B[i] = (lld)b[i]-48;
      lld moves = 0;
     	for(lld i = 0; i < len_b-len_a+1; i += 1){
     		moves += check(i,i+len_a-1,i);
     	}
     	cout << moves;
      return 0;
}


// if you get a wrong answer but you are convinced
// that your logic is correct do :- 1) read the
// entire code and try to find if something needs
// to be added 2) start making test cases that you
// think can possibly give WA.
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <vector>
#include <string>
using namespace std;
typedef double  dbl;
typedef long long int lld;
#define PI 3.14159265358979323
#define foi(i,n) for(lld i = 0; i < n; i+=1)
#define fod(i,n) for(lld i=n-1; i >=0; i-=1)
#define MAX std::numeric_limits<lld>::max()
#define MIN std::numeric_limits<lld>::min()
#define FastIO  ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
lld check (lld A[], lld B[], lld l, lld r, lld offset)
{
	if (l ==r){
		return (B[l] xor A[l-offset]);
	}
	if (l < r){
		lld mid = (l+r)/2;
		return (check(A,B,l,mid,offset)+check(A,B,mid+1,r,offset));
	}
}
int main ()
{
      #ifndef ONLINE_JUDGE
      freopen("inputf.in",  "r",  stdin);
      freopen("outputf.in", "w", stdout);
      #endif
      FastIO
      string a;
      string b;
      cin >> a >> b;
      lld len_a = a.size(), len_b = b.size();
      lld A[len_a], B[len_b];
      for(lld i = 0; i < len_a; i += 1)
      	A[i] = (lld)a[i]-48;
      for(lld i = 0; i < len_b; i += 1)
      	B[i] = (lld)b[i]-48;
      lld moves = 0;
     	for(lld i = 0; i < len_b-len_a+1; i += 1){
     		moves += check(A,B,i,i+len_a-1,i);
     	}
     	cout << moves;
      return 0;
}


#include<bits/stdc++.h>
#include <stdint.h>
#define int long long int
#define pb push_back
#define maxv *max_element
#define des greater<int>()
#define mp make_pair
#define mod 1000000007
#define loop(x,s,n) for(int x = s; x < n; x++)
using namespace std;
int32_t main(){
    string a,b;
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    cin>>a>>b;
    int al = a.size();
    int bl = b.size();
    int b_prefix[bl+1] ={0};
    // if(b[0]=='1')
    //     b_prefix[0]=1;
    loop(i,0,bl){
        if(b[i]=='1')
            b_prefix[i+1] = b_prefix[i]+1;
        else
            b_prefix[i+1] = b_prefix[i];
        // cout<<b_prefix[i+1]<<" ";
    }
    // cout<<endl;
    int res =0;
    loop(i,0,al){
        int start = i+1;
        int end = i+bl-al+1;
        // cout<<start<<" "<<end<<endl;
        if(a[i]=='0')
            res+= b_prefix[end]-b_prefix[start-1];
        else
            res+=  bl-al+1 - (b_prefix[end]-b_prefix[start-1]);
    }
    // int res=0,ham=0;
    // loop(i,0,al){
    //     ham+= abs(int(a[i])-int(b[i]));
    // }
    // res+=ham;
    // loop(i,1,bl-al+1){
    //     cout<<ham<<endl;
    //     int j = i-1;
    //     ham-= abs(int(a[0])-int(b[j]));
    //     ham+= abs(int(a[al-1])-int(b[i+al-1]));
    //     res+=ham;
    // }
    cout<<res<<endl;
}


#include<bits/stdc++.h>
#include <stdint.h>
#define int long long int
#define pb push_back
#define maxv *max_element
#define des greater<int>()
#define mp make_pair
#define mod 1000000007
#define loop(x,s,n) for(int x = s; x < n; x++)
using namespace std;
int32_t main(){
    string a,b;
    // ios_base::sync_with_stdio(0);
    // cin.tie(NULL);
    cin>>a>>b;
    int al = a.size();
    int bl = b.size();
    int b_prefix[bl+1] ={0};
    // if(b[0]=='1')
    //     b_prefix[0]=1;
    loop(i,0,bl){
        if(b[i]=='1')
            b_prefix[i+1] = b_prefix[i]+1;
        else
            b_prefix[i+1] = b_prefix[i];
        // cout<<b_prefix[i+1]<<" ";
    }
    // cout<<endl;
    int res =0;
    loop(i,0,al){
        int start = i+1;
        int end = i+bl-al+1;
        // cout<<start<<" "<<end<<endl;
        if(a[i]=='0')
            res+= b_prefix[end]-b_prefix[start-1];
        else
            res+=  bl-al+1 - (b_prefix[end]-b_prefix[start-1]);
    }
    // int res=0,ham=0;
    // loop(i,0,al){
    //     ham+= abs(int(a[i])-int(b[i]));
    // }
    // res+=ham;
    // loop(i,1,bl-al+1){
    //     cout<<ham<<endl;
    //     int j = i-1;
    //     ham-= abs(int(a[0])-int(b[j]));
    //     ham+= abs(int(a[al-1])-int(b[i+al-1]));
    //     res+=ham;
    // }
    cout<<res<<endl;
}


#include<bits/stdc++.h>
#include <stdint.h>
// #define int long long int
#define pb push_back
#define maxv *max_element
#define des greater<int>()
#define mp make_pair
#define mod 1000000007
#define loop(x,s,n) for(int x = s; x < n; x++)
using namespace std;
int32_t main(){
    string a,b;
    cin>>a>>b;
    int al = a.size();
    int bl = b.size();
    int res=0,ham=0;
    loop(i,0,al){
        ham+= abs(int(a[i])-int(b[i]));
    }
    res+=ham;
    loop(i,al,bl-al+1){
        int j = i-al;
        ham-= abs(int(a[0])-int(b[j]));
        ham+= abs(int(a[al-1])-int(b[i]));
        res+=ham;
    }
    cout<<res<<endl;
}


#include<bits/stdc++.h>
#include <stdint.h>
// #define int long long int
#define pb push_back
#define maxv *max_element
#define des greater<int>()
#define mp make_pair
#define mod 1000000007
#define loop(x,s,n) for(int x = s; x < n; x++)
using namespace std;
int32_t main(){
    string a,b;
    cin>>a>>b;
    int al = a.size();
    int bl = b.size();
    int b_prefix[bl+1] ={0};
    // if(b[0]=='1')
    //     b_prefix[0]=1;
    loop(i,0,bl){
        if(b[i]=='1')
            b_prefix[i+1] = b_prefix[i]+1;
        else
            b_prefix[i+1] = b_prefix[i];
        // cout<<b_prefix[i+1]<<" ";
    }
    // cout<<endl;
    int res =0;
    loop(i,0,al){
        int start = i+1;
        int end = i+bl-al+1;
        // cout<<start<<" "<<end<<endl;
        if(a[i]=='0')
            res+= b_prefix[end]-b_prefix[start-1];
        else
            res+=  bl-al+1 - (b_prefix[end]-b_prefix[start-1]);
    }
    // int res=0,ham=0;
    // loop(i,0,al){
    //     ham+= abs(int(a[i])-int(b[i]));
    // }
    // res+=ham;
    // loop(i,1,bl-al+1){
    //     cout<<ham<<endl;
    //     int j = i-1;
    //     ham-= abs(int(a[0])-int(b[j]));
    //     ham+= abs(int(a[al-1])-int(b[i+al-1]));
    //     res+=ham;
    // }
    cout<<res<<endl;
}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
/**
sum is s = r - (l-1)
numbers used in prefix: p = r - (l-1)
~ are odd, then s--
p - p / 2 + s / 2 is how many of specific number there is
*/
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    string a, b;
    cin >> a >> b;
    const int k = a.size();
    const int n = b.size();
    if (n == k) {
        int s = 0;
        for(int i = 0; i < n; i++) {
            if (a[i] == b[i]) s++;
        }
        cout << s;
    } else {
        int pref[n+1];
        pref[0] = 0;
        for(int i = 0; i < k; i++) {
            pref[i+1] = pref[i];
            if (a[i] == '1') pref[i+1]++;
        }

        if (2 * (k-1) >= n) {
            int sum = 0, ones, zeros;
            for(int i = 1; i <= n - (k-1); i++) {
                ones = pref[i] - pref[0];
                zeros = i - ones;
                if (b[i-1] == '1') sum += zeros;
                else sum += ones;
            }
            int lines = n - k + 2;
            //int st = lines - (n - (k-1)) + 1;
            int st = 2;
            int nd = n - (n - (k-1)) - 1;
            for(int i = lines; i <= n; i++) {
                ones = pref[nd] - pref[st-1];
                zeros = (nd-st+1) - ones;
                nd = min(k, nd+1);
                st = min(k, st+1);
                if (b[i-1] == '1') sum += zeros;
                else sum += ones;
            }
            cout << sum;
        } else {
            int sum = 0, ones, zeros;
            for(int i = 1; i <= k-1; i++) {
                ones = pref[i] - pref[0];
                zeros = i - ones;
                if (b[i-1] == '1') sum += zeros;
                else sum += ones;
            }
            int fullones = pref[k] - pref[0];
            int fullzeros = k - fullones;
            //cout << fullones << " " << fullzeros << " ";
            for(int i = k-1; i <=  n - k; i++) {
                //cout << b[i] << " ";
                if (b[i] == '1') sum += fullzeros;
                else sum += fullones;
            }
            int st = 2;
            int nd = k;
            for(int i = n - k + 1; i < n; i++) {
                ones = pref[nd] - pref[st-1];
                zeros = (nd-st+1) - ones;
                nd = min(k, nd+1);
                st = min(k, st+1);
                if (b[i-1] == '1') sum += zeros;
                else sum += ones;
            }
            cout << sum << "\n";
           /* for(int i = 0; i <= k; i++) {
                cout << pref[i] << " ";
            }*/
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define int long long
/**
sum is s = r - (l-1)
numbers used in prefix: p = r - (l-1)
~ are odd, then s--
p - p / 2 + s / 2 is how many of specific number there is
*/
signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    string a, b;
    cin >> a >> b;
    const int k = a.size();
    const int n = b.size();
    if (n == k) {
        int s = 0;
        for(int i = 0; i < n; i++) {
            if (a[i] != b[i]) s++;
        }
        cout << s;
    } else {
        int pref[n+1];
        pref[0] = 0;
        for(int i = 0; i < k; i++) {
            pref[i+1] = pref[i];
            if (a[i] == '1') pref[i+1]++;
        }

        if (2 * (k-1) >= n) {
            int sum = 0, ones, zeros;
            for(int i = 1; i <= n - (k-1); i++) {
                ones = pref[i] - pref[0];
                zeros = i - ones;
                if (b[i-1] == '1') sum += zeros;
                else sum += ones;
            }
            int lines = n - k + 2;
            //int st = lines - (n - (k-1)) + 1;
            int st = 2;
            int nd = n - (n - (k-1)) - 1;
            for(int i = lines; i <= n; i++) {
                ones = pref[nd] - pref[st-1];
                zeros = (nd-st+1) - ones;
                nd = min(k, nd+1);
                st = min(k, st+1);
                if (b[i-1] == '1') sum += zeros;
                else sum += ones;
            }
            cout << sum;
        } else {
            int sum = 0, ones, zeros;
            for(int i = 1; i <= k-1; i++) {
                ones = pref[i] - pref[0];
                zeros = i - ones;
                if (b[i-1] == '1') sum += zeros;
                else sum += ones;
            }
            int fullones = pref[k] - pref[0];
            int fullzeros = k - fullones;
            //cout << fullones << " " << fullzeros << " ";
            for(int i = k-1; i <=  n - k; i++) {
                //cout << b[i] << " ";
                if (b[i] == '1') sum += fullzeros;
                else sum += fullones;
            }
            int st = 2;
            int nd = k;
            for(int i = n - k + 1; i < n; i++) {
                ones = pref[nd] - pref[st-1];
                zeros = (nd-st+1) - ones;
                nd = min(k, nd+1);
                st = min(k, st+1);
                if (b[i] == '1') sum += zeros;
                else sum += ones;
            }
            cout << sum << "\n";
           /* for(int i = 0; i <= k; i++) {
                cout << pref[i] << " ";
            }*/
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
/**
sum is s = r - (l-1)
numbers used in prefix: p = r - (l-1)
~ are odd, then s--
p - p / 2 + s / 2 is how many of specific number there is
*/
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    string a, b;
    cin >> a >> b;
    const int k = a.size();
    const int n = b.size();
    if (n == k) {
        int s = 0;
        for(int i = 0; i < n; i++) {
            if (a[i] != b[i]) s++;
        }
        cout << s;
    } else {
        int pref[n+1];
        pref[0] = 0;
        for(int i = 0; i < k; i++) {
            pref[i+1] = pref[i];
            if (a[i] == '1') pref[i+1]++;
        }

        if (2 * (k-1) >= n) {
            int sum = 0, ones, zeros;
            for(int i = 1; i <= n - (k-1); i++) {
                ones = pref[i] - pref[0];
                zeros = i - ones;
                if (b[i-1] == '1') sum += zeros;
                else sum += ones;
            }
            int lines = n - k + 2;
            //int st = lines - (n - (k-1)) + 1;
            int st = 2;
            int nd = n - (n - (k-1)) - 1;
            for(int i = lines; i <= n; i++) {
                ones = pref[nd] - pref[st-1];
                zeros = (nd-st+1) - ones;
                nd = min(k, nd+1);
                st = min(k, st+1);
                if (b[i-1] == '1') sum += zeros;
                else sum += ones;
            }
            cout << sum;
        } else {
            int sum = 0, ones, zeros;
            for(int i = 1; i <= k-1; i++) {
                ones = pref[i] - pref[0];
                zeros = i - ones;
                if (b[i-1] == '1') sum += zeros;
                else sum += ones;
            }
            int fullones = pref[k] - pref[0];
            int fullzeros = k - fullones;
            //cout << fullones << " " << fullzeros << " ";
            for(int i = k-1; i <=  n - k; i++) {
                //cout << b[i] << " ";
                if (b[i] == '1') sum += fullzeros;
                else sum += fullones;
            }
            int st = 2;
            int nd = k;
            for(int i = n - k + 1; i < n; i++) {
                ones = pref[nd] - pref[st-1];
                zeros = (nd-st+1) - ones;
                nd = min(k, nd+1);
                st = min(k, st+1);
                if (b[i-1] == '1') sum += zeros;
                else sum += ones;
            }
            cout << sum << "\n";
           /* for(int i = 0; i <= k; i++) {
                cout << pref[i] << " ";
            }*/
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define int long long
/**
sum is s = r - (l-1)
numbers used in prefix: p = r - (l-1)
~ are odd, then s--
p - p / 2 + s / 2 is how many of specific number there is
*/
signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    string a, b;
    cin >> a >> b;
    const int k = a.size();
    const int n = b.size();
    if (n == k) {
        int s = 0;
        for(int i = 0; i < n; i++) {
            if (a[i] != b[i]) s++;
        }
        cout << s;
    } else {
        int pref[n+1];
        pref[0] = 0;
        for(int i = 0; i < k; i++) {
            pref[i+1] = pref[i];
            if (a[i] == '1') pref[i+1]++;
        }

        if (2 * (k-1) >= n) {
            int sum = 0, ones, zeros;
            for(int i = 1; i <= n - (k-1); i++) {
                ones = pref[i] - pref[0];
                zeros = i - ones;
                if (b[i-1] == '1') sum += zeros;
                else sum += ones;
            }
            int lines = n - k + 2;
            //int st = lines - (n - (k-1)) + 1;
            int st = 2;
            int nd = n - (k-2);
            for(int i = lines; i <= n; i++) {
                ones = pref[nd] - pref[st-1];
                zeros = (nd-st+1) - ones;
                nd = min(k, nd+1);
                st = min(k, st+1);
                if (b[i-1] == '1') sum += zeros;
                else sum += ones;
            }
            cout << sum;
        } else {
            int sum = 0, ones, zeros;
            for(int i = 1; i <= k-1; i++) {
                ones = pref[i] - pref[0];
                zeros = i - ones;
                if (b[i-1] == '1') sum += zeros;
                else sum += ones;
            }
            int fullones = pref[k] - pref[0];
            int fullzeros = k - fullones;
            //cout << fullones << " " << fullzeros << " ";
            for(int i = k-1; i <=  n - k; i++) {
                //cout << b[i] << " ";
                if (b[i] == '1') sum += fullzeros;
                else sum += fullones;
            }
            int st = 2;
            int nd = k;
            for(int i = n - k + 1; i < n; i++) {
                ones = pref[nd] - pref[st-1];
                zeros = (nd-st+1) - ones;
                nd = min(k, nd+1);
                st = min(k, st+1);
                if (b[i] == '1') sum += zeros;
                else sum += ones;
            }
            cout << sum << "\n";
           /* for(int i = 0; i <= k; i++) {
                cout << pref[i] << " ";
            }*/
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
/**
sum is s = r - (l-1)
numbers used in prefix: p = r - (l-1)
~ are odd, then s--
p - p / 2 + s / 2 is how many of specific number there is
*/
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    string a, b;
    cin >> a >> b;
    const int k = a.size();
    const int n = b.size();
    if (n == k) {
        int s = 0;
        for(int i = 0; i < n; i++) {
            if (a[i] != b[i]) s++;
        }
        cout << s;
    } else {
        int pref[n+1];
        pref[0] = 0;
        for(int i = 0; i < k; i++) {
            pref[i+1] = pref[i];
            if (a[i] == '1') pref[i+1]++;
        }

        if (2 * (k-1) >= n) {
            int sum = 0, ones, zeros;
            for(int i = 1; i <= n - (k-1); i++) {
                ones = pref[i] - pref[0];
                zeros = i - ones;
                if (b[i-1] == '1') sum += zeros;
                else sum += ones;
            }
            int lines = n - k + 2;
            //int st = lines - (n - (k-1)) + 1;
            int st = 2;
            int nd = n - (n - (k-1)) - 1;
            for(int i = lines; i <= n; i++) {
                ones = pref[nd] - pref[st-1];
                zeros = (nd-st+1) - ones;
                nd = min(k, nd+1);
                st = min(k, st+1);
                if (b[i-1] == '1') sum += zeros;
                else sum += ones;
            }
            cout << sum;
        } else {
            int sum = 0, ones, zeros;
            for(int i = 1; i <= k-1; i++) {
                ones = pref[i] - pref[0];
                zeros = i - ones;
                if (b[i-1] == '1') sum += zeros;
                else sum += ones;
            }
            int fullones = pref[k] - pref[0];
            int fullzeros = k - fullones;
            //cout << fullones << " " << fullzeros << " ";
            for(int i = k-1; i <=  n - k; i++) {
                //cout << b[i] << " ";
                if (b[i] == '1') sum += fullzeros;
                else sum += fullones;
            }
            int st = 2;
            int nd = k;
            for(int i = n - k + 1; i < n; i++) {
                ones = pref[nd] - pref[st-1];
                zeros = (nd-st+1) - ones;
                nd = min(k, nd+1);
                st = min(k, st+1);
                if (b[i] == '1') sum += zeros;
                else sum += ones;
            }
            cout << sum << "\n";
           /* for(int i = 0; i <= k; i++) {
                cout << pref[i] << " ";
            }*/
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
using ll=long long;
ll change(string a,string b)
{
//   return __builtin_popcount(a^b);  // for numbers
ll cnt=0;
for(int i=min(int(a.size())-1,int(b.size())-1);i>=0;i--)
{
    if(a[i]!=b[i]) cnt++;
}
return cnt;
}
int main()
{
    string a,b;cin>>a>>b;

    string s="";
    for(int i=0;i<a.size();i++) s+=b[i];
    int ans=change(a,s);
    for(int i=a.size();i<int(b.size());i++)
    {
        s+=b[i];
        s.erase(i-a.size());
        ans+=change(a,s);
    }
    cout<<ans<<endl;

}


#include<bits/stdc++.h>
using namespace std;
using ll=long long;
// ll change(string a,string b)
// {

// ll cnt=0;
// for(int i=0;i<b.size();i++)
// {
//     cnt+=(abs((a[i]-'0')-(b[i]-'0')));
// }
// return cnt;
// }
int main()
{      ios_base::sync_with_stdio(false);
cin.tie(nullptr) ;cout.tie(nullptr);
    string a,b;cin>>a>>b;

    int zeros[b.size()]; int ones[b.size()];
    if(b[0]=='0') zeros[0]=1; else zeros[0]=0;
    for(int i=1;i<b.size();i++)
    {
        if(b[i]=='0') zeros[i]=zeros[i-1]+1;
        else zeros[i]=zeros[i-1];
    }

    if(b[0]=='1') ones[0]=1; else ones[0]=0;
    for(int i=1;i<b.size();i++)
    {
        if(b[i]=='1') ones[i]=ones[i-1]+1;
        else ones[i]=ones[i-1];
    }
    int cnt=0;int j=0;
    if(a[0]=='0') cnt+=(ones[b.size()-a.size()]);
    else cnt+=(zeros[b.size()-a.size()]);
    for(int i=1;i<a.size();i++)
    {
        if(a[i]=='0') cnt+=(ones[b.size()-a.size()+i]-ones[j]);
        else cnt+=(zeros[b.size()-a.size()+i]-zeros[j]);

        j++;
    }
//   for(int i=0;i<b.size();i++) cout<<zeros[i]<<" ";
//   cout<<endl;
//     for(int i=0;i<b.size();i++) cout<<ones[i]<<" ";
    cout<<cnt<<endl;

}


#include<bits/stdc++.h>
using namespace std;
using ll=long long;
ll change(string a,string b)
{

ll cnt=0;
for(int i=0;i<b.size();i++)
{
    cnt+=(abs((a[i]-'0')-(b[i]-'0')));
}
return cnt;
}
int main()
{      ios_base::sync_with_stdio(false);
cin.tie(nullptr) ;cout.tie(nullptr);
    string a,b;cin>>a>>b;

    string s="";
    for(int i=0;i<a.size();i++) s+=b[i];
    int ans=change(a,s);
    for(int i=a.size();i<int(b.size());i++)
    {
        s.push_back(b[i]);
        s.erase(s.begin());

        ans+=change(a,s);

    }
    cout<<ans<<endl;

}


#include<bits/stdc++.h>
using namespace std;
using ll=long long;
// ll change(string a,string b)
// {

// ll cnt=0;
// for(int i=0;i<b.size();i++)
// {
//     cnt+=(abs((a[i]-'0')-(b[i]-'0')));
// }
// return cnt;
// }
int main()
{      ios_base::sync_with_stdio(false);
cin.tie(nullptr) ;cout.tie(nullptr);
    string a,b;cin>>a>>b;

    ll zeros[b.size()]; ll ones[b.size()];
    if(b[0]=='0') zeros[0]=1; else zeros[0]=0;
    for(ll i=1;i<b.size();i++)
    {
        if(b[i]=='0') zeros[i]=zeros[i-1]+1;
        else zeros[i]=zeros[i-1];
    }

    if(b[0]=='1') ones[0]=1; else ones[0]=0;
    for(ll i=1;i<b.size();i++)
    {
        if(b[i]=='1') ones[i]=ones[i-1]+1;
        else ones[i]=ones[i-1];
    }
    ll cnt=0;ll j=0;
    if(a[0]=='0') cnt+=(ones[b.size()-a.size()]);
    else cnt+=(zeros[b.size()-a.size()]);
    for(ll i=1;i<a.size();i++)
    {
        if(a[i]=='0') cnt+=(ones[b.size()-a.size()+i]-ones[j]);
        else cnt+=(zeros[b.size()-a.size()+i]-zeros[j]);

        j++;
    }
//   for(int i=0;i<b.size();i++) cout<<zeros[i]<<" ";
//   cout<<endl;
//     for(int i=0;i<b.size();i++) cout<<ones[i]<<" ";
    cout<<cnt<<endl;

}


#include <bits/stdc++.h>

#define ll long long
#define vc vector<char>
#define vi vector<int>
#define vl vector<ll>
#define vs vector<string>
#define si set<int>
#define pii pair<ll,ll>
#define pbi pair<bool,ll>
#define vpii vector<pii>
#define SORT(c) sort(c.begin(),c.end())
#define SORTC(c, cmp) sort(c.begin(),c.end(),cmp)
#define mapii map<ll,ll>
#define mapll map<ll,ll>
#define pb push_back
#define F first
#define S second

using namespace std;

int main() {
    string a{}, b{};
    cin >> a >> b;
    int len = a.size();
    int result{};

    vi zeroes(b.size(), 0);
    vi ones(b.size(), 0);

    for (int i = 0; i < b.size(); ++i) {
        if (i > 0) {
            zeroes[i] = zeroes[i - 1];
            ones[i] = ones[i - 1];
        }
        if (b[i] == '0') {
            zeroes[i]++;
        } else {
            ones[i]++;
        }
    }

    for (int j = 0; j < len; ++j) {
        if (a[j] == '0') {
            result += ones[b.size() - len + j];
            if (j > 0)
                result -= ones[j - 1];
        } else {
            result += zeroes[b.size() - len + j];
            if (j > 0)
                result -= zeroes[j - 1];
        }
    }

    cout << result << endl;

}


#include <bits/stdc++.h>

#define ll long long
#define vc vector<char>
#define vi vector<int>
#define vl vector<ll>
#define vs vector<string>
#define si set<int>
#define pii pair<ll,ll>
#define pbi pair<bool,ll>
#define vpii vector<pii>
#define SORT(c) sort(c.begin(),c.end())
#define SORTC(c, cmp) sort(c.begin(),c.end(),cmp)
#define mapii map<ll,ll>
#define mapll map<ll,ll>
#define pb push_back
#define F first
#define S second

using namespace std;

int main() {
    string a{}, b{};
    cin >> a >> b;
    int len = a.size();
    ll result{};

    vi zeroes(b.size(), 0);
    vi ones(b.size(), 0);

    for (int i = 0; i < b.size(); ++i) {
        if (i > 0) {
            zeroes[i] = zeroes[i - 1];
            ones[i] = ones[i - 1];
        }
        if (b[i] == '0') {
            zeroes[i]++;
        } else {
            ones[i]++;
        }
    }

    for (int j = 0; j < len; ++j) {
        if (a[j] == '0') {
            result += ones[b.size() - len + j];
            if (j > 0)
                result -= ones[j - 1];
        } else {
            result += zeroes[b.size() - len + j];
            if (j > 0)
                result -= zeroes[j - 1];
        }
    }

    cout << result << endl;

}


#include <bits/stdc++.h>

#define ll long long
#define vc vector<char>
#define vi vector<int>
#define vl vector<ll>
#define vs vector<string>
#define si set<int>
#define pii pair<ll,ll>
#define pbi pair<bool,ll>
#define vpii vector<pii>
#define SORT(c) sort(c.begin(),c.end())
#define SORTC(c, cmp) sort(c.begin(),c.end(),cmp)
#define mapii map<ll,ll>
#define mapll map<ll,ll>
#define pb push_back
#define F first
#define S second

using namespace std;

int distance(string a, string b) {
    int result{};
    for (int i = 0; i < a.size(); ++i) {
        result += abs(a[i] - b[i]);
    }
    return result;
}

int main() {
    string a{}, b{};
    cin >> a >> b;
    int len = a.size();
    int result{};

    for (int i = 0; i < b.size() - len + 1; ++i) {
         result+=distance(a,b.substr(i, len));
    }

    cout<<result;

}


#include <bits/stdc++.h>

#define ll long long
#define vc vector<char>
#define vi vector<int>
#define vl vector<ll>
#define vs vector<string>
#define si set<int>
#define pii pair<ll,ll>
#define pbi pair<bool,ll>
#define vpii vector<pii>
#define SORT(c) sort(c.begin(),c.end())
#define SORTC(c, cmp) sort(c.begin(),c.end(),cmp)
#define mapii map<ll,ll>
#define mapll map<ll,ll>
#define pb push_back
#define F first
#define S second

using namespace std;

int main() {
    string a{}, b{};
    cin >> a >> b;
    int len = a.size();
    int result{};

    vi zeroes(b.size() , 0);
    vi ones(b.size(), 0);

    for (int i = 0; i < b.size(); ++i) {

        if (i > 0) {
            zeroes[i] = zeroes[i - 1];
            ones[i] = ones[i - 1];
        }

        if (b[i] == '0') {
            zeroes[i]++;
        } else {
            ones[i]++;
        }
    }

    for (int j = 0; j < len; ++j) {
        if (a[j]=='0'){
            result+=ones[b.size()-len+j-1];
        }
        else{
            result+=zeroes[b.size()-len+j-1];
        }
    }

//    for (int k = 0; k < len; ++k) {
//        for (int i = 0; i < b.length() - len + 1; ++i) {
//            result += abs(a[k] - b[i + k]);
//        }
//
//
//    }

//    for (int j = 0; j < b.size() - len+1; ++j) {
//        for (int i = 0; i < len; ++i) {
//            result += abs(b[j + i] - a[i]);
//        }
//    }

    cout << result;

}


#include <bits/stdc++.h>

#define ll long long
#define vc vector<char>
#define vi vector<int>
#define vl vector<ll>
#define vs vector<string>
#define si set<int>
#define pii pair<ll,ll>
#define pbi pair<bool,ll>
#define vpii vector<pii>
#define SORT(c) sort(c.begin(),c.end())
#define SORTC(c, cmp) sort(c.begin(),c.end(),cmp)
#define mapii map<ll,ll>
#define mapll map<ll,ll>
#define pb push_back
#define F first
#define S second

using namespace std;

int main() {
    string a{}, b{};
    cin >> a >> b;
    int len = a.size();
    int result{};

    vi zeroes(b.size() - len + 1, 0);
    vi ones(b.size() - len + 1, 0);

    for (int i = 0; i < b.size(); ++i) {

        if (i > 0) {
            zeroes[i] = zeroes[i - 1];
            ones[i] = ones[i - 1];
        }

        if (b[i] == '0') {
            zeroes[i]++;
        } else {
            ones[i]++;
        }
    }

    for (int j = 0; j < len; ++j) {
        if (a[j]=='0'){
            result+=ones[b.size()-len+j-1];
        }
        else{
            result+=zeroes[b.size()-len+j-1];
        }
    }

//    for (int k = 0; k < len; ++k) {
//        for (int i = 0; i < b.length() - len + 1; ++i) {
//            result += abs(a[k] - b[i + k]);
//        }
//
//
//    }

//    for (int j = 0; j < b.size() - len+1; ++j) {
//        for (int i = 0; i < len; ++i) {
//            result += abs(b[j + i] - a[i]);
//        }
//    }

    cout << result;

}


#include <bits/stdc++.h>

using namespace std;

#define endl '\n'
#define f first
#define s second

using ld = long double;
using ll = long long;
using ii = pair <int,int>;
using pll = pair <ll,ll>;
using vi = vector <int>;
using vll = vector <ll>;
using vii = vector <ii>;
using vpll = vector<pll>;

int main(){

  ios_base :: sync_with_stdio(false);
  cin.tie(NULL);

  string a,b;
  cin >> a >> b;
  int n = b.size();
  int m = a.size();

  vi times(n);
  for(int i=0;i<n;i++){
    times[i] = min({m,i+1,n-m+1,n-i});
  }

  vi pref(m+1,0);

  for(int i=1;i<=m;i++){
    pref[i] = pref[i-1];
    if(a[i-1] == '0')
      pref[i]++;
  }

  ll ans = 0;

  for(int i=0;i<n;i++){
    // cout << times[i] << " ";
    if(i >= n/2){
      ll qtd = pref[m]-pref[m-times[i]];
      if(b[i] == '0')
       qtd = times[i]-qtd;
      ans += qtd;
    }
    else{
      ll qtd = pref[times[i]];
      if(b[i] == '0')
        qtd = times[i]-qtd;
      ans += qtd;
    }
  }
  // cout << endl;
  cout << ans << endl;
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define endl '\n'
#define f first
#define s second

using ld = long double;
using ll = long long;
using ii = pair <int,int>;
using pll = pair <ll,ll>;
using vi = vector <int>;
using vll = vector <ll>;
using vii = vector <ii>;
using vpll = vector<pll>;

int main(){

  ios_base :: sync_with_stdio(false);
  cin.tie(NULL);

  string a,b;
  cin >> a >> b;
  int n = b.size();
  int m = a.size();

  vi pref(n+1,0);
  for(int i=1;i<=n;i++){
    pref[i] = pref[i-1];
    if(b[i-1] == '0')
      pref[i]++;
  }

  ll ans = 0;

  for(int i=0;i<m;i++){
    ll qtd = pref[n-m+i+1]-pref[i];
    if(a[i] == '1'){
      ans += qtd;
    }else{
      qtd = n-m+1-qtd;
      ans += qtd;
    }
  }

  cout << ans << endl;
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define endl '\n'

int toNum(char c){
  return c-'0';
}

int main(){

  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  string a,b;
  cin >> a >> b;

  int n = b.size();
  int sum = 0;
  int m = a.size();

  for(int i=0;i<n;i++){
    sum += abs(toNum(b[i]) - toNum(a[i%m]));
  }

  cout << sum << endl;

  return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define endl '\n'
#define f first
#define s second

using ld = long double;
using ll = long long;
using ii = pair <int,int>;
using pll = pair <ll,ll>;
using vi = vector <int>;
using vll = vector <ll>;
using vii = vector <ii>;
using vpll = vector<pll>;

int main(){

  ios_base :: sync_with_stdio(false);
  cin.tie(NULL);

  string a,b;
  cin >> a >> b;
  int n = b.size();
  int m = a.size();

  vi times(n);
  for(int i=0;i<n;i++){
    times[i] = min({m,n-i,i+1});
    if(i-m+1 < 0 && i+m-1>=n)
      times[i] = 1;
  }

  vi pref(m+1,0);

  for(int i=1;i<=m;i++){
    pref[i] = pref[i-1];
    if(a[i-1] == '0')
      pref[i]++;
  }

  ll ans = 0;

  for(int i=0;i<n;i++){
    // cout << times[i] << " ";
    if(i >= n/2){
      ll qtd = pref[m]-pref[m-times[i]];
      if(b[i] == '0')
       qtd = times[i]-qtd;
      ans += qtd;
    }
    else{
      ll qtd = pref[times[i]];
      if(b[i] == '0')
        qtd = times[i]-qtd;
      ans += qtd;
    }
  }
  // cout << endl;
  cout << ans << endl;
  return 0;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <set>
#include <utility>
#include <queue>
#include <map>
#include <assert.h>
#include <stack>
#include <string>
using namespace std;
void solve()
{
	string a, b; cin>>a>>b;
	int na=a.size();
	int nb=b.size();
	vector<int> pref0(nb, 0);
	vector<int> pref1(nb, 0);
	pref1[nb-1]=(b[nb-1]=='0' ? 1 : 0);
	pref0[nb-1]=(b[nb-1]=='0' ? 0 : 1);
	for (int j=nb-2; j>=0; j--)
	{
		pref1[j]=pref1[j+1]+(b[j]=='0' ? 1 : 0);
		pref0[j]=pref0[j+1]+(b[j]=='0' ? 0 : 1);
	}
	int ans=0;
	for (int j=na-1; j>=0; j--)
	{
		if (a[j]=='0')
		{
			ans+=pref0[j]-pref0[nb - 1 - (na - 1 - j)]+(b[nb-1-(na-1-j)]-'0');
		}
		else
		{
			ans+=pref1[j]-pref1[nb - 1 - (na - 1 - j)]+ abs((b[nb - 1 - (na - 1 - j)] - '1'));
		}
	}
	cout<<ans<<"\n";
	return;
}
signed main()
{
	ios::sync_with_stdio(0);
	cin.tie(NULL); cout.tie(NULL);
	int t;
	//cin >> t;
	t=1;
	while (t--)
	{
		solve();
	}
	return 0;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <set>
#include <utility>
#include <queue>
#include <map>
#include <assert.h>
#include <stack>
#include <string>
#define int long long int
using namespace std;
void solve()
{
	string a, b; cin>>a>>b;
	int na=a.size();
	int nb=b.size();
	vector<int> pref0(nb, 0);
	vector<int> pref1(nb, 0);
	pref1[nb-1]=(b[nb-1]=='0' ? 1 : 0);
	pref0[nb-1]=(b[nb-1]=='0' ? 0 : 1);
	for (int j=nb-2; j>=0; j--)
	{
		pref1[j]=pref1[j+1]+(b[j]=='0' ? 1 : 0);
		pref0[j]=pref0[j+1]+(b[j]=='0' ? 0 : 1);
	}
	int ans=0;
	for (int j=na-1; j>=0; j--)
	{
		if (a[j]=='0')
		{
			ans+=pref0[j]-pref0[nb - 1 - (na - 1 - j)]+(b[nb-1-(na-1-j)]-'0');
		}
		else
		{
			ans+=pref1[j]-pref1[nb - 1 - (na - 1 - j)]+ abs((b[nb - 1 - (na - 1 - j)] - '0')-1);
		}
		//cout << ans << " ";
	}
	cout<<ans<<"\n";
	return;
}
signed main()
{
	ios::sync_with_stdio(0);
	cin.tie(NULL); cout.tie(NULL);
	int t;
	//cin >> t;
	t=1;
	while (t--)
	{
		solve();
	}
	return 0;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <set>
#include <utility>
#include <queue>
#include <map>
#include <assert.h>
#include <stack>
#include <string>
using namespace std;
void solve()
{
	string a, b; cin>>a>>b;
	int na=a.size();
	int nb=b.size();
	int ans=0;
	for (int j=0; j<na; j++)
	{
		for (int i=j; i<nb; i+=na)
		{
			ans+=abs((b[i]-'0')-(a[j]-'0'));
		}
	}
	cout<<ans<<"\n";
	return;
}
signed main()
{
	ios::sync_with_stdio(0);
	cin.tie(NULL); cout.tie(NULL);
	int t;
	//cin >> t;
	t=1;
	while (t--)
	{
		solve();
	}
	return 0;
}


#include<bits/stdc++.h>
#define rep(i,a,b) for(i=a;i<b;i++)
#define ll long long
#define pii pair<int,int>
#define vi vector<int>
#define pb push_back
#define F first
#define S second
#define mp make_pair
#define se second
#define all(a) (a).begin(),(a).end()
#define endl '\n'
#define mp make_pair
#define MOD 1000000007
using namespace std;
int i,j;
int l1,l2,diff,num1,ans;
string a,b;
void code(){
    cin>>a>>b;
    l1=a.length();
    l2=b.length();
    diff=l2-l1+1;
    rep(i,0,diff)
        num1+=(b[i]-'0');
    rep(i,0,l1){
        if(a[i]=='0')
            ans+=num1;
        else
            ans+=(diff-num1);
        num1+=(b[i+diff]-'0');
        num1-=(b[i]-'0');
    }
    cout<<ans<<endl;
}
int main()
{
    ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int t=1;
	//cin>>t;
	while(t--){
        code();
	}
}


#include<bits/stdc++.h>
#define rep(i,a,b) for(i=a;i<b;i++)
#define ll long long
#define pii pair<int,int>
#define vi vector<int>
#define pb push_back
#define F first
#define S second
#define mp make_pair
#define se second
#define all(a) (a).begin(),(a).end()
#define endl '\n'
#define mp make_pair
#define MOD 1000000007
using namespace std;
int i,j,num1,ans;
int l1,l2;
string a,b;
void code(){
    cin>>a>>b;
    l1=a.length();
    l2=b.length();
    rep(i,0,l2-l1+1)
        num1+=(b[i]-'0');
    rep(i,0,l1){
        if(a[i]==0)
            ans+=num1;
        else
            ans+=(l2-l1+1-num1);
        num1+=(b[i+(l2-l1+1)]-'0');
        num1-=(b[i]-'0');
    }
    cout<<ans<<endl;
}
int main()
{
    ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int t=1;
	//cin>>t;
	while(t--){
        code();
	}
}


#include<bits/stdc++.h>
#define rep(i,a,b) for(i=a;i<b;i++)
#define ll long long
#define pii pair<int,int>
#define vi vector<int>
#define pb push_back
#define F first
#define S second
#define mp make_pair
#define se second
#define all(a) (a).begin(),(a).end()
#define endl '\n'
#define mp make_pair
#define MOD 1000000007
using namespace std;
int i,j;
int l1,l2,diff,num1;
ll ans;
string a,b;
void code(){
    cin>>a>>b;
    l1=a.length();
    l2=b.length();
    diff=l2-l1+1;
    rep(i,0,diff)
        num1+=(b[i]-'0');
    rep(i,0,l1){
        if(a[i]=='0'    )
            ans+=num1;
        else
            ans+=(diff-num1);
        num1+=(b[i+diff]-'0');
        num1-=(b[i]-'0');
    }
    cout<<ans<<endl;
}
int main()
{
    ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int t=1;
	//cin>>t;
	while(t--){
        code();
	}
}


#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

long int ham_dist(string a,string b)
{   long long int dist=0;
	for(int i=0;i<a.length();++i)
		dist+=abs((int)(a[i]-b[i]));
    return dist;
}

int main()
{     string a,b;
	 cin>>a;
	 cin>>b;
	 int l=a.length();
     long long int sum=0;
	 for(int i=0;i<b.length()-l;i++)
	 {    string subs=b.substr(i,l);
	 	  sum+=ham_dist(a,subs);
	 }
     cout<<sum;
}


#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;

/*
long int ham_dist(string a,string b)
{   long long int dist=0;
	for(int i=0;i<a.length();++i)
		dist+=abs((int)(a[i]-b[i]));
    return dist;
}
*/

int main()
{     string a,b;
	 cin>>a;
	 cin>>b;
	 int l=a.length();
     long long int sum=0;

     int freq[b.length()][2];   //f[x][c] gives number of c s before x

     for(int i=0;i<b.length();++i)
     {
     	for(int j=0;j<2;++j)
     		freq[i][j]=0;
     }

     for(int i=1;i<b.length();++i)
     {    if(b[i-1]=='0')
            freq[i][0]++;
          else
          	freq[i][1]++;

          freq[i][0]+=freq[i-1][0];
           freq[i][1]+=freq[i-1][1];
     }

	 for(int i=0;i<l;i++)
	 {
	     for(int j=0;j<2;++j)
	 	  sum+=abs(a[i]-j)*(freq[b.length()-l+i+1][j]-freq[i][j]);
	 }

     cout<<sum;

}


#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;

/*
long int ham_dist(string a,string b)
{   long long int dist=0;
	for(int i=0;i<a.length();++i)
		dist+=abs((int)(a[i]-b[i]));
    return dist;
}
*/

int main()
{     string a,b;
	 cin>>a;
	 cin>>b;
	 int l=a.length();
     long long int sum=0;

     int freq[b.length()+1][2];   //f[x][c] gives number of c s before x

     for(int i=0;i<b.length();++i)
     {
     	for(int j=0;j<2;++j)
     		freq[i][j]=0;
     }

     for(int i=1;i<b.length()+1;++i)
     {    if(b[i-1]=='0')
            freq[i][0]++;
          else
          	freq[i][1]++;

          freq[i][0]+=freq[i-1][0];
           freq[i][1]+=freq[i-1][1];
     }

	 for(int i=0;i<l;i++)
	 {
	     for(int j=0;j<2;++j)
	 	  sum+=abs(a[i]-j)*(freq[b.length()-l+i+1][j]-freq[i][j]);
	 }

     cout<<sum;

}


#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;

/*
long int ham_dist(string a,string b)
{   long long int dist=0;
	for(int i=0;i<a.length();++i)
		dist+=abs((int)(a[i]-b[i]));
    return dist;
}
*/

int main()
{     string a,b;
	 cin>>a;
	 cin>>b;
	 int l=a.length();
     long long int sum=0;

     int freq[b.length()+1][2];   //f[x][c] gives number of c s before x

     for(int i=0;i<b.length()+1;++i)
     {
     	for(int j=0;j<2;++j)
     		freq[i][j]=0;
     }

     for(int i=1;i<b.length()+1;++i)
     {    if(b[i-1]=='0')
            freq[i][0]++;
          else
          	freq[i][1]++;

          freq[i][0]+=freq[i-1][0];
           freq[i][1]+=freq[i-1][1];
     }

	 for(int i=0;i<l;i++)
	 {
	     for(int j=0;j<2;++j)
	 	  sum+=abs((a[i]-'0')-j)*(freq[b.length()-l+i+1][j]-freq[i][j]);
	 }

     cout<<sum;

}


#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;

/*
long int ham_dist(string a,string b)
{   long long int dist=0;
	for(int i=0;i<a.length();++i)
		dist+=abs((int)(a[i]-b[i]));
    return dist;
}
*/

int main()
{     string a,b;
	 cin>>a;
	 cin>>b;
	 int l=a.length();
     int sum=0;

     int freq[b.length()+1][2];   //f[x][c] gives number of c s before x

     for(int i=0;i<b.length();++i)
     {
     	for(int j=0;j<2;++j)
     		freq[i][j]=0;
     }

     for(int i=1;i<b.length()+1;++i)
     {    if(b[i-1]=='0')
            freq[i][0]++;
          else
          	freq[i][1]++;

          freq[i][0]+=freq[i-1][0];
           freq[i][1]+=freq[i-1][1];
     }

	 for(int i=0;i<l;i++)
	 {
	     for(int j=0;j<2;++j)
	 	  sum+=abs((a[i]-'0')-j)*(freq[b.length()-l+i+1][j]-freq[i][j]);
	 }

     cout<<sum;

}


#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;

/*
long int ham_dist(string a,string b)
{   long long int dist=0;
	for(int i=0;i<a.length();++i)
		dist+=abs((int)(a[i]-b[i]));
    return dist;
}
*/

int main()
{     string a,b;
	 cin>>a;
	 cin>>b;
	 int l=a.length();
     int sum=0;

     int freq[b.length()+1][2];   //f[x][c] gives number of c s before x

     for(int i=0;i<b.length()+1;++i)
     {
     	for(int j=0;j<2;++j)
     		freq[i][j]=0;
     }

     for(int i=1;i<b.length()+1;++i)
     {    if(b[i-1]=='0')
            freq[i][0]++;
          else
          	freq[i][1]++;

          freq[i][0]+=freq[i-1][0];
           freq[i][1]+=freq[i-1][1];
     }

	 for(int i=0;i<l;i++)
	 {
	     for(int j=0;j<2;++j)
	 	  sum+=abs((a[i]-'0')-j)*(freq[b.length()-l+i+1][j]-freq[i][j]);
	 }

     cout<<sum;

}


#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

long int ham_dist(string a,string b)
{   long long int dist=0;
	for(int i=0;i<a.length();++i)
		dist+=abs((int)(a[i]-b[i]));
    return dist;
}

int main()
{     string a,b;
	 cin>>a;
	 cin>>b;
	 int l=a.length();
     long long int sum=0;
	 for(int i=0;i<b.length()-l+1;i++)
	 {    string subs=b.substr(i,l);
	 	  sum+=ham_dist(a,subs);
	 }
     cout<<sum;
}


#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;

/*
long int ham_dist(string a,string b)
{   long long int dist=0;
	for(int i=0;i<a.length();++i)
		dist+=abs((int)(a[i]-b[i]));
    return dist;
}
*/

int main()
{     string a,b;
	 cin>>a;
	 cin>>b;
	 int l=a.length();
     int sum=0;

     int freq[b.length()+1][2];   //f[x][c] gives number of c s before x

     for(int i=0;i<b.length();++i)
     {
     	for(int j=0;j<2;++j)
     		freq[i][j]=0;
     }

     for(int i=1;i<b.length()+1;++i)
     {    if(b[i-1]=='0')
            freq[i][0]++;
          else
          	freq[i][1]++;

          freq[i][0]+=freq[i-1][0];
           freq[i][1]+=freq[i-1][1];
     }

	 for(int i=0;i<l;i++)
	 {
	     for(int j=0;j<2;++j)
	 	  sum+=abs(a[i]-j)*(freq[b.length()-l+i+1][j]-freq[i][j]);
	 }

     cout<<sum;

}


// 401A.cpp : Defines the entry point for the console application.
//

#include <iostream>
using namespace std;
int N,X, K, Sum = 0;

int main()
{
	cin >> N >> X;
	for (int i =0; i < N; i++)
	{
		cin >> K;
		Sum+= K;
	}
	cout << abs(Sum-1)/X + 1;
}


// 401A.cpp : Defines the entry point for the console application.
//

#include <iostream>
using namespace std;
int N,X, K, Sum = 0;

int main()
{
	cin >> N >> X;
	for (int i =0; i < N; i++)
	{
		cin >> K;
		Sum+= K;
	}
	if (Sum == 0)
	cout << "0";
	else
	cout << (abs(Sum)-1)/X + 1;
}


// 401A.cpp : Defines the entry point for the console application.
//

#include <iostream>
using namespace std;
int N,X, K, Sum = 0;

int main()
{
	cin >> N >> X;
	for (int i =0; i < N; i++)
	{
		cin >> K;
		Sum+= K;
	}
	cout << (abs(Sum)-1)/X + 1;
}


#include <stdio.h>
#include <Windows.h>
int main()
{
	int n, m, x, sum = 0;
	scanf("%d%d", &n, &m);
	for (int i = 0; i < n; ++i)
	{
		scanf("%d", &x);
		sum += x;
	}
	if (sum < 0)
	{
		sum *= -1;
	}
	if (sum == 0)
		printf("0");
	else if (sum <= m)
		printf("1");
	else
	{
		if (sum%m)
			sum += m;
		printf("%d", sum / m);
	}
	return 0;
}


#include <stdio.h>
#include <Windows.h>
int main()
{
	int n, m, x, sum = 0;
	scanf("%d%d", &n, &m);
	for (int i = 0; i < n; ++i)
	{
		scanf("%d", &x);
		sum += x;
	}
	if (sum < 0)
	{
		sum *= -1;
	}
	if (sum <= m)
		printf("1");
	else if (sum == m)
		printf("0");
	else
	{
		if (sum%m)
			sum += m;
		printf("%d", sum / m);
	}
	return 0;
}


#include <stdio.h>
#include <Windows.h>
int main()
{
	int n, m, x, sum = 0;
	scanf("%d%d", &n, &m);
	for (int i = 0; i < n; ++i)
	{
		scanf("%d", &x);
		sum += x;
	}
	if (sum < 0)
	{
		sum *= -1;
	}
	if (sum <= m)
		printf("1");
	else if (sum == 0)
		printf("0");
	else
	{
		if (sum%m)
			sum += m;
		printf("%d", sum / m);
	}
	return 0;
}


#include <stdio.h>
#include <Windows.h>
int main()
{
	int n, m, x, sum = 0;
	scanf("%d%d", &n, &m);
	for (int i = 0; i < n; ++i)
	{
		scanf("%d", &x);
		sum += x;
	}
	if (sum < 0)
	{
		sum *= -1;
	}
	if (sum <= m)
		printf("1");
	else
	{
		if (sum%m)
			sum += m;
		printf("%d", sum / m);
	}
	return 0;
}


#include<iostream>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<cctype>
#include<cstdlib>
#include<cstdio>
#include<stdio.h>
#include<vector>
#include<string>
#include<stack>
#include<list>
#include<queue>
#include<iomanip>
using namespace std;
int main()
{
    int n, x, sum = 0, temp;
    cin >> n >> x;
    for (int i = 0; i < n; i++)
    {
        cin >> temp;
        sum += temp;
    }
    int j ,count=0;
    if (sum>0)
    {
        j = -x;
        while (j < 0 && sum>0)
        {
            if(sum%abs(j)==0)
            {
                count+=sum/abs(j);
                sum=0;
            }
            else
            {
                count+=abs(sum/j);
                if(sum%abs(j)<x)
                {
                    count++;
                    sum+=abs(sum%j);
                    break;
                }
                else
                {
                    sum+=j;
                    count++;
                    j++;
                }
        }
    }
}
    else
    {
        j = x;
        while (j > 0 && sum < 0)
        {
            if(abs(sum)%j==0)
            {
                count+=abs(sum)/j;
                sum=0;
            }
            else
            {
                count+=abs(sum/x);
                if(abs(sum)%x<x)
                {
                    count++;
                    sum+=abs(sum%x);
                    break;
                }
                else
                {
                    sum+=j;
                    count++;
                    j--;
                }
            }
        }
    }
    cout << count<<endl;
    return 0;
}


#include<iostream>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<cctype>
#include<cstdlib>
#include<cstdio>
#include<stdio.h>
#include<vector>
#include<string>
#include<stack>
#include<list>
#include<queue>
#include<iomanip>
using namespace std;
int main()
{
    int n, x, sum = 0, temp;
    cin >> n >> x;
    for (int i = 0; i < n; i++)
    {
        cin >> temp;
        sum += temp;
    }
    int j ,count=0;
    if (sum>0)
    {
        j = -x;
        while (j < 0 && sum>0)
        {
            if(sum%abs(j)==0)
            {
                count+=sum/abs(j);
                sum=0;
            }
            else
            {
                sum+=j;
                count++;
            }
            j++;
        }
    }
    else
    {
        j = x;
        while (j > 0 && sum < 0)
        {
            if(abs(sum)%j==0)
            {
                count+=abs(sum)/j;
                sum=0;
            }
            else
            {
                sum+=j;
                count++;
            }
            j--;
        }
    }
    cout << count<<endl;
    return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<cctype>
#include<cstdlib>
#include<cstdio>
#include<stdio.h>
#include<vector>
#include<string>
#include<stack>
#include<list>
#include<queue>
#include<iomanip>
using namespace std;
int main()
{
	int n, x, sum = 0, temp;
	cin >> n >> x;
	for (int i = 0; i < n; i++)
	{
		cin >> temp;
		sum += temp;
	}
	int j ,count=0;
	if (sum>0)
	{
		j = -x;
		while (j < 0 && sum>0)
		{
			count++;
			sum += j;
			j++;
		}
	}
	else
	{
		j = x;
		while (j > 0 && sum < 0)
		{
			count++;
			sum += j;
			j++;
		}
	}
	cout << count<<endl;
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<cctype>
#include<cstdlib>
#include<cstdio>
#include<stdio.h>
#include<vector>
#include<string>
#include<stack>
#include<list>
#include<queue>
#include<iomanip>
using namespace std;
int main()
{
    int n, x, sum = 0, temp;
    cin >> n >> x;
    for (int i = 0; i < n; i++)
    {
        cin >> temp;
        sum += temp;
    }
    int j ,count=0;
    if (sum>0)
    {
        j = -x;
        while (j < 0 && sum>0)
        {
            if (sum + j > 0)
            {
                count++;
                sum += j;
            }
            j++;
        }
    }
    else
    {
        j = x;
        while (j > 0 && sum < 0)
        {
            if (sum + j>0)
            {
                count++;
                sum += j;
            }
            j++;
        }
    }
    cout << count<<endl;
    return 0;
}


#include<iostream>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<cctype>
#include<cstdlib>
#include<cstdio>
#include<stdio.h>
#include<vector>
#include<string>
#include<stack>
#include<list>
#include<queue>
#include<iomanip>
using namespace std;
int main()
{
    int n, x, sum = 0, temp;
    cin >> n >> x;
    for (int i = 0; i < n; i++)
    {
        cin >> temp;
        sum += temp;
    }
    int j ,count=0;
    if (sum>0)
    {
        j = -x;
        while (j < 0 && sum>0)
        {
			if(sum%abs(j)==0)
			{
				count+=sum/abs(j);
				sum=0;
			}
			else
			{
				sum+=j;
				count++;
			}
            j++;
        }
    }
    else
    {
        j = x;
        while (j > 0 && sum < 0)
        {
          	if(abs(sum)%j==0)
			{
				count+=abs(sum)/j;
				sum=0;
			}
			else
			{
				sum+=j;
				count++;
			}
            j++;
        }
    }
    cout << count<<endl;
    return 0;
}


#include <iostream>
#include <algorithm>
#include <stack>
#include <vector>
#include <string>
#include <map>
#include <set>
using namespace std;

long int num[300001];
long long int result;
void score(long long int sum,long int step,long int n)
{
    if(step==n-1)
        return;
    result+=sum;
        return score(sum-num[step],step+1,n);
}

int main()
{
    int n,x,temp,result=0,sum=0;
    cin>>n>>x;
    for(int i=0;i<n;i++)
    {
        cin>>temp;
        sum+=temp;
    }
    sum=abs(sum);
    ++x;
    while(x--)
    {
        while(x<=sum && sum)
        {
            sum-=x;
            result++;
        }
    }
    cout<<result<<endl;
}


#include <iostream>
#include <algorithm>
#include <stack>
#include <vector>
#include <string>
#include <map>
#include <set>
using namespace std;

long int num[300001];
long long int result;
void score(long long int sum,long int step,long int n)
{
    if(step==n-1)
        return;
    result+=sum;
        return score(sum-num[step],step+1,n);
}

int main()
{
    int num_p[1001]={0},num_n[1001]={0},num_t[1001]={0},n,x,temp,result=0,dif;
    cin>>n>>x;
    for(int i=0;i<n;i++)
    {
        cin>>temp;
        if(temp>0)
            num_p[temp]++;
        else if(temp<0)
            num_n[-temp]++;
        result+=abs(num_p[abs(temp)]-num_n[abs(temp)])-num_t[abs(temp)];
        num_t[abs(temp)]=abs(num_p[abs(temp)]-num_n[abs(temp)]);
    }
    cout<<result<<endl;
}


#include <iostream>
#include <algorithm>
#include <stack>
#include <vector>
#include <string>
#include <map>
#include <set>
using namespace std;

long int num[300001];
long long int result;
void score(long long int sum,long int step,long int n)
{
    if(step==n-1)
        return;
    result+=sum;
        return score(sum-num[step],step+1,n);
}

int main()
{
    int num_p[1001]={0},num_n[1001]={0},num_t[1001]={0},n,x,temp,result=0,dif;
    cin>>n>>x;
    for(int i=0;i<n;i++)
    {
        cin>>temp;
        if(temp>0)
            num_p[temp]++;
        else if(temp<0)
            num_n[-temp]++;
        result+=(abs(num_p[abs(temp)]-num_n[abs(temp)])>num_t[abs(temp)]) ? 1:-1;
        num_t[abs(temp)]=abs(num_p[abs(temp)]-num_n[abs(temp)]);
    }
    cout<<result<<endl;
}


#include <iostream>
#include <algorithm>
#include <stack>
#include <vector>
#include <string>
#include <map>
#include <set>
using namespace std;

long int num[300001];
long long int result;
void score(long long int sum,long int step,long int n)
{
    if(step==n-1)
        return;
    result+=sum;
        return score(sum-num[step],step+1,n);
}

int main()
{
    int num_p[1001]={0},num_n[1001]={0},num_t[1001]={0},n,x,temp,result=0,dif;
    cin>>n>>x;
    for(int i=0;i<n;i++)
    {
        cin>>temp;
        if(temp>0)
            num_p[temp]++;
        else if(temp<0)
            num_n[-temp]++;
        if(temp)
        {
            result+=(abs(num_p[abs(temp)]-num_n[abs(temp)])>num_t[abs(temp)]) ? 1:-1;
            num_t[abs(temp)]=abs(num_p[abs(temp)]-num_n[abs(temp)]);
        }
    }
    cout<<result<<endl;
}


#include <iostream>
#include <fstream>
#include <string>
#include <cmath>

using namespace std;

const string
	inputFileName = "input.txt",
	outputFileName = "output.txt";

void main()
{
	#if defined(DEBUG) || defined(_DEBUG)
	ifstream cin(inputFileName.c_str());
	ofstream cout(outputFileName.c_str());
	#endif

	int c, x;
	cin >> c >> x;

	int left = 0, right = 0;

	int tmp;
	for(int i = 0; i < c; i++)
	{
		cin >> tmp;
		if(tmp <= 0)
			left += tmp;
		else
			right += tmp;
	}

	float summ = left + right;
	//cout << summ << " ";
	summ = std::abs(summ);
	//cout << summ << " ";
	float xx = x;
	summ = summ / xx;
	//cout << summ << " ";
	summ = std::ceil(summ);
	//cout << summ << " ";
	cout << summ;
	//input.close();
	//output.close();

	//cout << "lol" << endl; getchar();

}


#include <iostream>
#include <fstream>
#include <string>
#include <cmath>

using namespace std;

const string
	inputFileName = "input.txt",
	outputFileName = "output.txt";

void main()
{
	ifstream input(inputFileName.c_str());
	ofstream output(outputFileName.c_str());

	int c, x;
	input >> c >> x;

	int left = 0, right = 0;

	int tmp;
	for(int i = 0; i < c; i++)
	{
		input >> tmp;
		if(tmp <= 0)
			left += tmp;
		else
			right += tmp;
	}

	float summ = left + right;
	summ = std::abs(summ);
	float xx = x;
	summ = summ / xx;

	summ = std::ceil(summ);

	output << summ;

	input.close();
	output.close();

	//cout << "lol" << endl; getchar();

}


#include <iostream>
#include <fstream>
#include <string>
#include <cmath>

using namespace std;

const string
	inputFileName = "input.txt",
	outputFileName = "output.txt";

void main()
{
	ifstream input(inputFileName.c_str());
	ofstream output(outputFileName.c_str());

	int c, x;
	input >> c >> x;

	int left = 0, right = 0;

	int tmp;
	for(int i = 0; i < c; i++)
	{
		input >> tmp;
		if(tmp <= 0)
			left += tmp;
		else
			right += tmp;
	}

	float summ = left + right;
	summ = std::abs(summ);
	float xx = x;
	summ = summ / xx;

	summ = std::ceil(summ);

	output << summ << " max^ " << x << " "<< left << "/" << right;

	input.close();
	output.close();

	//cout << "lol" << endl; getchar();

}


#include <iostream>
using namespace std;
int abso(int a){
    if (a > 0){
        return a;
    }
    return -a;
}
int main(){
    int n, x; cin >> n >> x;
    x++;
    int *needed = new int[x];
    for (int i = 0; i < x; i++){
        needed[i] = 0;
    }
    for (int i = 0; i < n; i++){
        int temp; cin >> temp;
        if (temp > 0){
            needed[temp]++;
        }
        else{
            needed[temp]--;
        }
    }
    int counter = 0;
    for (int i = 0; i < x; i++){
        counter += abso(needed[i]);
    }
    cout << counter;
}


#include <iostream>
using namespace std;

int abso(int a){
    if (a > 0){
        return a;
    }
    return -a;
}

int main(){
    int n, x; cin >> n >> x;
    int sum = 0;
    for (int i=0; i < n; i++){
        int temp; cin >> temp;
        sum += temp;
    }
    sum = abso(sum);
    cout << sum / x + (bool)(sum%x);
}


#include <iostream>
using namespace std;
int abso(int a){
    if (a > 0){
        return a;
    }
    return -a;
}
int main(){
    int n, x; cin >> n >> x;
    x++;
    int *needed = new int[x];
    for (int i = 0; i < x; i++){
        needed[i] = 0;
    }
    for (int i = 0; i < n; i++){
        int temp; cin >> temp;
        if (temp > 0){
            needed[temp]++;
        }
        else{
            needed[abso(temp)]--;
        }
    }
    int counter = 0;
    for (int i = 0; i < x; i++){
        counter += abso(needed[i]);
    }
    cout << counter;
}


#include<iostream>
#include<string>
#include<cmath>
#include<cctype>
#include<vector>
#include<sstream>
using namespace std;
int main(){
	int n,x;
	cin>>n>>x;
	int a[1000];
	int p;
	int s=0;
	for(int i=0;i<n;i++){
		cin>>p;
		a[i]=p;
		s+=p;
	}
	int d=abs(s)/x;
	if(abs(s)%x==0){
		cout<<d;
	}
	else{
		cout<<d+1;
	}

	return 0;
}


#include<iostream>
#include<string>
#include<cmath>
#include<cctype>
#include<vector>
#include<sstream>
using namespace std;
int main(){
	int n,x;
	cin>>n>>x;
	int a[1000];
	int p;
	for(int i=0;i<n;i++){
		cin>>p;
		a[i]=p;
	}
	int s=0;
	int d=0;
	for(int i=0;i<n;i++){
		d=0;
		if(a[i]==0){
			continue;
		}
		for(int j=i+1;j<n;j++){
			if(a[i]==-a[j]){
				d+=1;
				a[j]=0;
				break;
			}
		}
		if(d==0){
			s++;
		}
	}
	cout<<s;

	return 0;
}


// Muhammed Sabbah
#include <iostream>
#include <string>

using namespace std;

int main()
{
	int n,k,a[1000];
	cin>>n>>k;
	int count = 0;
	int card = 0;
	for(int i=0;i<n;i++)
	{
		cin>>card;
		count+=card;
	}
	count = abs(count);
	card=0;
	if(count%k)
		card++;
	card += count/k;
	cout<<card<<endl;
	return 0;
}


// Muhammed Sabbah
#include <iostream>
#include <string>

using namespace std;

int main()
{
	int n,k,a[1000];
	cin>>n>>k;
	int count = 0;
	int card = 0;
	for(int i=0;i<n;i++)
	{
		cin>>card;
		count+=card;
	}
	count = abs(count);
	card=0;
	if(count%k)
		card++;
	card = count/k;
	cout<<card<<endl;
	return 0;
}


// Muhammed Sabbah
#include <iostream>
#include <string>

using namespace std;

int main()
{
	int n,k;
	cin>>n>>k;
	int count = 0;
	int card = 0;
	for(int i=0;i<n;i++)
	{
		int num;
		cin>>num;
		if( abs( (count + num) - 0 ) > abs(count-0) )
			card++;
		else
			card--;
		count+=num;
	}
	cout<<card<<endl;
	return 0;
}


#include <vector>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <map>
#include <set>

using namespace std;
const int max_n = 100;

int main()
{
    //freopen("input.txt", "r", stdin);
    int n, x;
    cin >> n >> x;
    vector <int> v(n);
    int s = 0;
    for (int i = 0; i < n; i++)
    {
        cin >> v[i];
        s += v[i];
    }
    if (abs(s) == 0)
            cout << 0 << endl;
    else
    if (abs(s) <= x)
    {
        cout << 1 << endl;
    }
    else
    {
        int cnt = 0;
        cnt = abs(s) / x;
        if (abs(s) % x != 0) cnt++;
        cout << cnt << endl;

    }

    return 0;
}


#include <vector>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <map>
#include <set>

using namespace std;
const int max_n = 100;

int main()
{
    //freopen("input.txt", "r", stdin);
    int n, x;
    cin >> n >> x;
    vector <int> v(n);
    int s = 0;
    for (int i = 0; i < n; i++)
    {
        cin >> v[i];
        s += v[i];
    }
    if (abs(s) <= x)
    {
        cout << 1 << endl;

    }
    else
    {
        int cnt = 0;
        cnt = abs(s) / x + 1;
        cout << cnt << endl;

    }

    return 0;
}


#include <vector>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <map>
#include <set>

using namespace std;
const int max_n = 100;

int main()
{
    //freopen("input.txt", "r", stdin);
    int n, x;
    cin >> n >> x;
    vector <int> v(n);
    int s = 0;
    for (int i = 0; i < n; i++)
    {
        cin >> v[i];
        s += v[i];
    }
    if (abs(s) <= x)
    {
        cout << 1 << endl;

    }
    else
    {
        int cnt = 0;
        cnt = abs(abs(s) / x) + 1;
        cout << cnt << endl;

    }

    return 0;
}


#include <vector>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <map>
#include <set>

using namespace std;
const int max_n = 100;

int main()
{
    //freopen("input.txt", "r", stdin);
    int n, x;
    cin >> n >> x;
    vector <int> v(n);
    int s = 0;
    for (int i = 0; i < n; i++)
    {
        cin >> v[i];
        s += v[i];
    }
    if (abs(s) <= x)
    {
        cout << abs(x) << endl;

    }
    else
    {
        int cnt = 0;
        cnt = abs(s) / x + 1;
        cout << cnt << endl;

    }

    return 0;
}


#include <vector>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <map>
#include <set>

using namespace std;
const int max_n = 100;

int main()
{
    //freopen("input.txt", "r", stdin);
    int n, x;
    cin >> n >> x;
    vector <int> v(n);
    int s = 0;
    for (int i = 0; i < n; i++)
    {
        cin >> v[i];
        s += v[i];
    }
    if (abs(s) <= x)
    {
        if (abs(s) == 0)
            cout << 0 << endl;
        else
        cout << 1 << endl;

    }
    else
    {
        int cnt = 0;
        cnt = abs(s) / x + 1;
        cout << cnt << endl;

    }

    return 0;
}


#include <vector>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <map>
#include <set>

using namespace std;
const int max_n = 100;

int main()
{
    //freopen("input.txt", "r", stdin);
    int n, x;
    cin >> n >> x;
    vector <int> v(n);
    int s = 0;
    for (int i = 0; i < n; i++)
    {
        cin >> v[i];
        s += v[i];
    }
    if (abs(s) == 0)
            cout << 0 << endl;
    else
    if (abs(s) <= x)
    {
        cout << 1 << endl;
    }
    else
    {
        int cnt = 0;
        cnt = abs(s) / x;
        if (abs(s) % x == 1) cnt++;
        cout << cnt << endl;

    }

    return 0;
}


#include <vector>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <map>
#include <set>

using namespace std;
const int max_n = 100;

int main()
{
    //freopen("input.txt", "r", stdin);
    int n, x;
    cin >> n >> x;
    vector <int> v(n);
    int s = 0;
    for (int i = 0; i < n; i++)
    {
        cin >> v[i];
        s += v[i];
    }
    if (abs(s) == 0)
            cout << 0 << endl;
    else
    if (abs(s) <= x)
    {
        cout << 1 << endl;
    }
    else
    {
        int cnt = 0;
        cnt = abs(s) / x;
        if (cnt % 2 == 1) cnt++;
        cout << cnt << endl;

    }

    return 0;
}


#include <vector>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <map>
#include <set>

using namespace std;
const int max_n = 100;

int main()
{
    //freopen("input.txt", "r", stdin);
    int n, x;
    cin >> n >> x;
    vector <int> v(n);
    int s = 0;
    for (int i = 0; i < n; i++)
    {
        cin >> v[i];
        s += v[i];
    }
    if (abs(s) == 0)
            cout << 0 << endl;
    else
    if (abs(s) <= x)
    {
        cout << 1 << endl;
    }
    else
    {
        int cnt = 0;
        cnt = abs(s) / x;
        if (abs(s) % 2 == 1) cnt++;
        cout << cnt << endl;

    }

    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <queue>
#include <iomanip>
#include <cstdio>
#include <limits>
#include <cmath>
#include <cstdlib>
#include <string.h>
#include <ctime>

using namespace std;

#define VI vector<int>
#define VVI vector<VI >
#define VB vector<bool>
#define VVB vector<VB >
#define VS vector<string>
#define PII pair<int, int>
#define VPII vector<pair<int, int> >
#define REP(var, startFrom, endTo) for(int var = startFrom; var < (int)endTo; ++var)

template <typename T>
inline const T MAX(T a, T b) { return ((a) > (b) ? (a) : (b)); }
template <typename T>
inline const T MIN(T a, T b) { return ((a) > (b) ? (b) : (a)); }
template <typename T>
inline const T ABS(T a) { return (((a) > 0) ? (a) : (-(a))); }

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
#ifndef ONLINE_JUDGE
	freopen("tmp.in", "r", stdin);
//	freopen("tmp.out", "w", stderr);
#endif
	int n, x;
	cin >> n >> x;

	int sum = 0;
	for (int i = 0; i < n; ++i)
	{
		int num;
		cin >> num;

		sum += num;
	}

	sum = ABS(sum);
	if (sum == 0)
		cout << 0 << endl;
	else if (sum <= x)
		cout << 1 << endl;
	else
		cout << (sum / x) + 1 << endl;

	return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <queue>
#include <iomanip>
#include <cstdio>
#include <limits>
#include <cmath>
#include <cstdlib>
#include <string.h>
#include <ctime>

using namespace std;

#define VI vector<int>
#define VVI vector<VI >
#define VB vector<bool>
#define VVB vector<VB >
#define VS vector<string>
#define PII pair<int, int>
#define VPII vector<pair<int, int> >
#define REP(var, startFrom, endTo) for(int var = startFrom; var < (int)endTo; ++var)

template <typename T>
inline const T MAX(T a, T b) { return ((a) > (b) ? (a) : (b)); }
template <typename T>
inline const T MIN(T a, T b) { return ((a) > (b) ? (b) : (a)); }
template <typename T>
inline const T ABS(T a) { return (((a) > 0) ? (a) : (-(a))); }

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
#ifndef ONLINE_JUDGE
	freopen("tmp.in", "r", stdin);
//	freopen("tmp.out", "w", stderr);
#endif
	int n, x;
	cin >> n >> x;

	int sum = 0;
	for (int i = 0; i < n; ++i)
	{
		int num;
		cin >> num;

		sum += num;
	}

	sum = ABS(sum);
	if (sum == 0)
		cout << 0 << endl;
	else if (sum <= x)
		cout << 1 << endl;
	else if (sum % x == 0)
		cout << (sum / x) << endl;
	else
		cout << (sum / x) + 1 << endl;

	return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <queue>
#include <iomanip>
#include <cstdio>
#include <limits>
#include <cmath>
#include <cstdlib>
#include <string.h>
#include <ctime>

using namespace std;

#define VI vector<int>
#define VVI vector<VI >
#define VB vector<bool>
#define VVB vector<VB >
#define VS vector<string>
#define PII pair<int, int>
#define VPII vector<pair<int, int> >
#define REP(var, startFrom, endTo) for(int var = startFrom; var < (int)endTo; ++var)

template <typename T>
inline const T MAX(T a, T b) { return ((a) > (b) ? (a) : (b)); }
template <typename T>
inline const T MIN(T a, T b) { return ((a) > (b) ? (b) : (a)); }
template <typename T>
inline const T ABS(T a) { return (((a) > 0) ? (a) : (-(a))); }

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
#ifndef ONLINE_JUDGE
	freopen("tmp.in", "r", stdin);
//	freopen("tmp.out", "w", stderr);
#endif
	int n, x;
	cin >> n >> x;

	int sum = 0;
	for (int i = 0; i < n; ++i)
	{
		int num;
		cin >> num;

		sum += num;
	}

	sum = ABS(sum);
	if (sum <= x)
		cout << 1 << endl;
	else
		cout << (sum / x) + 1 << endl;

	return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <queue>
#include <iomanip>
#include <cstdio>
#include <limits>
#include <cmath>
#include <cstdlib>
#include <string.h>
#include <ctime>

using namespace std;

#define VI vector<int>
#define VVI vector<VI >
#define VB vector<bool>
#define VVB vector<VB >
#define VS vector<string>
#define PII pair<int, int>
#define VPII vector<pair<int, int> >
#define REP(var, startFrom, endTo) for(int var = startFrom; var < (int)endTo; ++var)

template <typename T>
inline const T MAX(T a, T b) { return ((a) > (b) ? (a) : (b)); }
template <typename T>
inline const T MIN(T a, T b) { return ((a) > (b) ? (b) : (a)); }
template <typename T>
inline const T ABS(T a) { return (((a) > 0) ? (a) : (-(a))); }

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
#ifndef ONLINE_JUDGE
	freopen("tmp.in", "r", stdin);
//	freopen("tmp.out", "w", stderr);
#endif
	int n, x;
	cin >> n >> x;

	int sum = 0;
	for (int i = 0; i < n; ++i)
	{
		int num;
		cin >> num;

		sum += num;
	}

	sum = ABS(sum);
	if (sum <= x)
		cout << 1 << endl;
	else
		cout << (sum / x) + (sum % x) << endl;

	return 0;
}


#include<iostream>
using namespace std;

int main()
{
    int n , x;
    cin>>n>>x;
    int temp;
    long long int sum = 0;
    for(int i = 0 ; i < n ; i++){
        cin>>temp;
        sum+=temp;
    }

    if(sum < 0)sum = sum * -1;
    else if (sum ==0){
        cout<<0;
        return 0;
    }
    if(sum <= x){
        cout<<1 ;
        return 0;
    }
    int num = 0;
    num +=sum/x;
    num ++;
    cout<<num;

    return 0;
}


#include<iostream>
using namespace std;

int main()
{
    int n , x;
    cin>>n>>x;
    int temp;
    long long int sum = 0;
    for(int i = 0 ; i < n ; i++){
        cin>>temp;
        sum+=temp;
    }

    if(sum < 0)sum = sum * -1;
    else if (sum ==0){
        cout<<0;
        return 0;
    }
    if(sum <= x){
        cout<<1 ;
        return 0;
    }
    int num = 0;
    num +=sum/x;
    if(sum%x != 0)
    num ++;
    cout<<num;

    return 0;
}


#include<iostream>
using namespace std;

int main()
{
    int n , x;
    cin>>n>>x;
    int temp;
    int sum = 0;
    for(int i = 0 ; i < x ; i++){
        cin>>temp;
        sum+=temp;
    }

    if(sum < 0)sum = sum * -1;
    else if (sum ==0){
        cout<<0;
        return 0;
    }
    if(sum <= n){
        cout<<1 ;
        return 0;
    }
    int num = 0;
    num +=sum/n;
    num ++;
    cout<<num;

    return 0;
}


#include<iostream>
using namespace std;

int main()
{
    int n , x;
    cin>>n>>x;
    int temp;
    int sum = 0;
    for(int i = 0 ; i < n ; i++){
        cin>>temp;
        sum+=temp;
    }

    if(sum < 0)sum = sum * -1;
    else if (sum ==0){
        cout<<0;
        return 0;
    }
    if(sum <= x){
        cout<<1 ;
        return 0;
    }
    int num = 0;
    num +=sum/x;
    num ++;
    cout<<num;

    return 0;
}


// Solution by Saeed Keshavarzi

#include <map>
#include <set>
#include <list>
#include <queue>
#include <stack>
#include <deque>
#include <ctime>
#include <bitset>
#define _USE_MATH_DEFINES
#include <cmath>
#include <string>
#include <vector>
#include <cctype>
#include <cstdlib>
#include <sstream>
#include <cassert>
#include <utility>
#include <complex>
#include <cstdio>
#include <memory.h>
#include <iostream>
#include <algorithm>

    #define ini()   ios::sync_with_stdio(false); cin.tie(NULL)
    #define ret()   return 0

#define For(i, n)       for( int (i) = 0; (i) < (n); ++(i) )
#define Forn(i, a, b)   for( int (i) = (a); (i) < (b); ++(i) )
#define SET(t, v)       memset((t), (v), sizeof(t))

using namespace::std;

//      signed int                  // -2e9  to 2e9   // (-2147483648)          - (2147483647)           // %d
typedef unsigned int        uint;   // 0     to 4e9   // (0)                    - (4294967295)           // %u
typedef signed long long    int64;  // -9e18 to 9e18  // (-9223372036854775808) - (9223372036854775807)  // %I64d
typedef unsigned long long  uint64; // 0     to 18e18 // (0)                    - (18446744073709551615) // %I64u
typedef vector<int>         VI;
typedef pair<int, int>      PII;
const double EPS(1E-9);

int main()
{
    ini();

    int n, x, out;
    int k, temp;

    cin >> k >> x;
    n = 0;
    For(i, k)
    {
        cin >> temp;
        n += temp;
    }

    n = (n >= 0 ? n : -n);
    x = (x >= 0 ? x : -x);
    out = n / x + 1;
    cout << out;

    ret();
}


// Solution by Saeed Keshavarzi

#include <map>
#include <set>
#include <list>
#include <queue>
#include <stack>
#include <deque>
#include <ctime>
#include <bitset>
#define _USE_MATH_DEFINES
#include <cmath>
#include <string>
#include <vector>
#include <cctype>
#include <cstdlib>
#include <sstream>
#include <cassert>
#include <utility>
#include <complex>
#include <cstdio>
#include <memory.h>
#include <iostream>
#include <algorithm>

    #define ini()   ios::sync_with_stdio(false); cin.tie(NULL)
    #define ret()   return 0

#define For(i, n)       for( int (i) = 0; (i) < (n); ++(i) )
#define Forn(i, a, b)   for( int (i) = (a); (i) < (b); ++(i) )
#define SET(t, v)       memset((t), (v), sizeof(t))

using namespace::std;

//      signed int                  // -2e9  to 2e9   // (-2147483648)          - (2147483647)           // %d
typedef unsigned int        uint;   // 0     to 4e9   // (0)                    - (4294967295)           // %u
typedef signed long long    int64;  // -9e18 to 9e18  // (-9223372036854775808) - (9223372036854775807)  // %I64d
typedef unsigned long long  uint64; // 0     to 18e18 // (0)                    - (18446744073709551615) // %I64u
typedef vector<int>         VI;
typedef pair<int, int>      PII;
const double EPS(1E-9);

int main()
{
    ini();

    int n, x, out;
    int k, temp;

    cin >> k >> x;
    n = 0;
    For(i, k)
    {
        cin >> temp;
        n += temp;
    }

    n = (n >= 0 ? n : -n);
    x = (x >= 0 ? x : -x);
    out = (n % x != 0 ? n / x + 1 : n / x) ;
    cout << out;

    ret();
}


// Solution by Saeed Keshavarzi

#include <map>
#include <set>
#include <list>
#include <queue>
#include <stack>
#include <deque>
#include <ctime>
#include <bitset>
#define _USE_MATH_DEFINES
#include <cmath>
#include <string>
#include <vector>
#include <cctype>
#include <cstdlib>
#include <sstream>
#include <cassert>
#include <utility>
#include <complex>
#include <cstdio>
#include <memory.h>
#include <iostream>
#include <algorithm>

    #define ini()   ios::sync_with_stdio(false); cin.tie(NULL)
    #define ret()   return 0

#define For(i, n)       for( int (i) = 0; (i) < (n); ++(i) )
#define Forn(i, a, b)   for( int (i) = (a); (i) < (b); ++(i) )
#define SET(t, v)       memset((t), (v), sizeof(t))

using namespace::std;

//      signed int                  // -2e9  to 2e9   // (-2147483648)          - (2147483647)           // %d
typedef unsigned int        uint;   // 0     to 4e9   // (0)                    - (4294967295)           // %u
typedef signed long long    int64;  // -9e18 to 9e18  // (-9223372036854775808) - (9223372036854775807)  // %I64d
typedef unsigned long long  uint64; // 0     to 18e18 // (0)                    - (18446744073709551615) // %I64u
typedef vector<int>         VI;
typedef pair<int, int>      PII;
const double EPS(1E-9);

int main()
{
    ini();

    int n, x, out;
    int k, temp;

    cin >> k >> x;
    n = 0;
    For(i, k)
    {
        cin >> temp;
        n += temp;
    }

    n = (n >= 0 ? n : -n);
    x = (x >= 0 ? x : -x);
    out = (n / x != 0 ? n / x + 1 : n / x);
    cout << out;

    ret();
}


#include <iostream>
#include <string>
#include <math.h>
using namespace std;

int main()
{
	int a, b;
	cin >> a >> b;
	int l = 0, y = 0, z = 0,x=0,r=0;
	int*c = new int[a];
	for (int m = 0; m < a; m++) {
		cin >> c[m];
	}
	for (int e = 0; e < a; e++) {
		for (int i = e + 1; i < a; i++) {
			if (c[e] != b + 1){
				l = c[e] * -1;
				if (l == c[i]) {
					c[i] = b + 1;
					c[e] = b + 1;
				}
			}
		}
	}
	for (int k = 0; k < a; k++) {
		if (c[k] != b + 1 ) z+=c[k];

	}
	if(z%b==0)x=0;
	else x=1;
	r=abs(z/b)+x;

	cout << r;
    return 0;
}


#include <iostream>
#include <string>
using namespace std;

int main()
{
	int a, b;
	cin >> a >> b;
	int l = 0, y = 0, z = 0;
	int*c = new int[a];
	for (int m = 0; m < a; m++) {
		cin >> c[m];
	}
	for (int e = 0; e < a; e++) {
		for (int i = e + 1; i < a; i++) {
			if (c[e] != b + 1&&c[e]!=b){
				l = c[e] * -1;
				if (l == c[i]) {
					c[i] = b + 1;
					c[e] = b + 1;
				}
			}
		}
	}
	for (int k = 0; k < a; k++) {
		if (c[k] != b + 1 && c[k] != b) z++;

	}
	cout << z;
    return 0;
}


#include <iostream>
#include <string>
using namespace std;

int main()
{
	int a, b;
	cin >> a >> b;
	int l = 0, y = 0, z = 0;
	int*c = new int[a];
	for (int m = 0; m < a; m++) {
		cin >> c[m];
	}
	for (int e = 0; e < a; e++) {
		for (int i = e + 1; i < a; i++) {
			if (c[e] != b + 1) {
				l = c[e] * -1;
				if (l == c[i]) {
					c[i] = b + 1;
					c[e] = b + 1;
				}
			}
		}
	}
	for (int k = 0; k < a; k++) {
		if (c[k] != b + 1)z++;
	}
	cout << z;
    return 0;
}


#include <iostream>
#include <string>
using namespace std;

int main()
{
	int a, b;
	cin >> a >> b;
	int l = 0, y = 0, z = 0,x=0,r=0;
	int*c = new int[a];
	for (int m = 0; m < a; m++) {
		cin >> c[m];
	}
	for (int e = 0; e < a; e++) {
		for (int i = e + 1; i < a; i++) {
			if (c[e] != b + 1){
				l = c[e] * -1;
				if (l == c[i]) {
					c[i] = b + 1;
					c[e] = b + 1;
				}
			}
		}
	}
	for (int k = 0; k < a; k++) {
		if (c[k] != b + 1 ) z+=c[k];

	}
	if(z%b==0)x=0;
	else x=1;
	r=z/b+x;
	cout << r;
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
int a[1005];
int main()
{
	int n,x,m;
	scanf("%d%d",&n,&x);
	for(int i=0;i<n;i++)
	{
		scanf("%d",&m);
		if(m>=0)
		{
			a[m]++;
		}
		else
		{
			a[-m]--;
		}
	}
	int ans=0;
	for(int i=1;i<=x;i++)
	{
		if(a[i]!=0)
		{
			ans+=a[i];
		}
	}
	if(ans<0) ans=-ans;
	int b=ans/x;
	int c=ans%x;
	if(c!=0)
	{
		b++;
	}
	printf("%d\n",b);
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
int a[1005];
int main()
{
    int n,x,m;
    scanf("%d%d",&n,&x);
    for(int i=0;i<n;i++)
    {
        scanf("%d",&m);
        if(m>=0)
        {
            a[m]++;
        }
        else
        {
            a[-m]--;
        }
    }
    int ans=0;
    for(int i=1;i<=x;i++)
    {
        if(a[i]!=0)
        {
            ans+=a[i]*i;
        }
    }
    if(ans<0) ans=-ans;
    //printf("%d\n",ans);
    int b=ans/x;
    int c=ans%x;
    if(c!=0)
    {
        b++;
    }
    printf("%d\n",b);
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
int a[1005];
int main()
{
    int n,x,m;
    scanf("%d%d",&n,&x);
    for(int i=0;i<n;i++)
    {
        scanf("%d",&m);
        if(m>=0)
        {
            a[m]++;
        }
        else
        {
            a[-m]--;
        }
    }
    int ans=0;
    for(int i=1;i<=x;i++)
    {
        if(a[i]!=0)
        {
            if(a[i]>0)
            {
                ans+=a[i];
            }
            else
            {
                ans-=a[i];
            }
        }
    }
    printf("%d\n",ans);
}


#include <cstdlib>
#include <fstream>
#include <iostream>
using namespace std;
int main(){
	//ifstream in("input.txt");
	//ofstream out("output.txt");
	int n,x,a ;
	long long sum=0;
	cin>>n>>x;
	for(int i=0;i<n;i++){
		cin>>a;
		sum+=a;
	}
	if(abs(sum)<=x)cout<<1;
	else if(abs(sum)%x==0)cout<<abs(sum)/x;
	else cout<<(int)(abs(sum)/x)+1;
}


#include <cstdlib>
#include <fstream>
#include <iostream>
using namespace std;
int main(){
	ifstream in("input.txt");
	ofstream out("output.txt");
	int n,x,a ;
	long long sum=0;
	cin>>n>>x;
	for(int i=0;i<n;i++){
		cin>>a;
		sum+=a;
	}
	if(abs(sum)<=x)cout<<1;
	else if(abs(sum)%x==0)cout<<abs(sum)/x;
	else {
		int c=1;
		while (x*c<=abs(sum)){
			c++;
		}
		cout<<c-1;
	}
}


#include <cstdlib>
#include <fstream>
#include <iostream>
using namespace std;
int main(){
	ifstream in("input.txt");
	ofstream out("output.txt");
	int n,x,a ;
	long long sum=0;
	cin>>n>>x;
	for(int i=0;i<n;i++){
		cin>>a;
		sum+=a;
	}
	if(abs(sum)<=x)cout<<1;
	else {
		int c=1;
		while (x*c<=abs(sum)){
			c++;
		}
		cout<<c;
	}
}


#include <cstdlib>
#include <fstream>
#include <iostream>
using namespace std;
int main(){
	ifstream in("input.txt");
	ofstream out("output.txt");
	int n,x,a ;
	long long sum=0;
	cin>>n>>x;
	for(int i=0;i<n;i++){
		cin>>a;
		sum+=a;
	}
	if(abs(sum)<=x)cout<<1;
	else if(abs(sum)%x==0)cout<<abs(sum)/x;
	else {
		int c=1;
		while (x*c<=abs(sum)){
			c++;
		}
		cout<<c;
	}
}


#include <cstdlib>
#include <fstream>
#include <iostream>
using namespace std;
int main(){
	ifstream in("input.txt");
	ofstream out("output.txt");
	int n,x,a ;
	long long sum=0;
	cin>>n>>x;
	for(int i=0;i<n;i++){
		cin>>a;
		sum+=a;
	}
	if(sum==0)cout<<0;
	else if(abs(sum)<=x)cout<<1;
	else {
		int c=1;
		while (x*c<=abs(sum)){
			c++;
		}
		cout<<c;
	}
}


#include <cstdlib>
#include <fstream>
#include <iostream>
using namespace std;
int main(){
	//ifstream in("input.txt");
	//ofstream out("output.txt");
	int n,x,a ;
	long long sum=0;
	cin>>n>>x;
	for(int i=0;i<n;i++){
		cin>>a;
		sum+=a;
	}
	if(abs(sum)<=x)cout<<1;
	else if(abs(sum)%x==0)cout<<abs(sum)/x;
	else cout<<(int)(abs(sum)/x);
}


#include <cstdlib>
#include <fstream>
#include <iostream>
using namespace std;
int main(){
	ifstream in("input.txt");
	ofstream out("output.txt");
	int n,x,a ;
	long long sum=0;
	cin>>n>>x;
	for(int i=0;i<n;i++){
		cin>>a;
		sum+=a;
	}
	if(sum==0)cout<<0;
	else if(abs(sum)<=x)cout<<1;
	else {
		int c=0;
		while (x*c<abs(sum)){
			c++;
		}
		cout<<c;
	}
}


#include<iostream>
#include<math.h>
#include<string>
#include<vector>
#include <stdio.h>
#include <stdlib.h>
#include<algorithm>
#include<iomanip>
using namespace std;

int SumOfDigits (int n)
 {
	 int sum=0;
	 int a=1;
	 while((n/a)!=0)
	 {
		  a*=10;
		 sum+=(n%a/(a/10));
	 }
	 return sum;
 }//����� ��������� � �����
int fact(int n)
{
	int res=1;
	for(int i=1;i<=n;i++)
		res*=i;
	return res;
}//���������
int fibon_number_by_place(int n)
{
	int i=0;
	int a1=0,a2=1,temp;
	while(i<n)
	{
		temp=a2;
		a2=a1+a2;
		a1=temp;
		i++;
	}
	return a1;
}//�������� ����� �������� �� ������
int fibon_place_by_number(int n)
{
	int a1=0,a2=1,temp,i=0;
	while(a1!=n)
	{
		if(n<a1)
		{i=-1;break;}
		temp=a2;
		a2=a1+a2;
		a1=temp;
		i++;
	}
	return i;
}//����� ����� �������� �� �������
int MinDigit(int n){

	int res1=999999999,a=1;
	while((n/a)!=0)
	{
		a*=10;
		if((n%a/(a/10))<res1)
		{res1=(n%a/(a/10));}
	}
	return res1;
}//����������� ������� �����
int MaxDigit(int n){

	int res2=0,a=1;
	while((n/a)!=0)
	{
		 a*=10;
		 if((n%a/(a/10))>res2)
		 {res2=(n%a/(a/10));}
	}
	return res2;
}//������������ ������� �����
int NumberOfZeroes(int n)
{
	int res=0,a=1;
	if(n==0)
		res++;
	while((n/a)!=0)
	 {
		 a*=10;
		 if((n%a/(a/10))==0)
		 {res++;}
	 }
	return res;
}//���-�� ����� � �����
string BinaryNumber(int n)
{
	int a=1;
	string s="",s2="";
	while(n!=0)
	{
		if(n%2==0)
			s+='0';
		else
			s+='1';
		n/=2;
	}
	for(int i=s.length()-1;i>=0;i--)
		s2+=s[i];
	return s2;
}//�������� ����� ����� ��������
int reverseNumber(int n)
{
	int res=0,a=1;
	while((n/a)!=0)
	 {
		 a*=10;
		 cout << (n%a/(a/10));
	}
	return 0;
}//�������� ����� �����
int PalindromeCount(int n)
{
	int b=0,count=0;
	for(int z=1;z<=n;z++)
	{
		int i=1;
		while(z/i/10!=0)
		{i*=10;}
		int a=1;
		while((z/a)!=0)
		{
			a*=10;
			b+=(z%a/(a/10))*i;
			i/=10;
		}
		if(z-b==0)
			count++;
		b=0;
	}

	return count;
}
bool isCompare(string S1, string S2)
{
	bool flag=true;

	if(S1.size()==S2.size())
		for(int i=0;i<S1.size();i++)
		{
			if(S1[i]!=S2[i])
			{flag=false;break;}
		}
	else
		flag=false;
	return flag;
}
bool isPalindrome(string s)
{
	bool flag=true;
	int j=s.size()-1;
	for(int i=0;i<s.size()/2;i++)
	{
		if(s[i]!=s[j])
		{flag=false;break;}
		j--;
	}
	return flag;
}
vector<int> prefix_func(string s)
{
	int n=s.length();
	vector<int> pi(n);
	for(int i=1; i<n; i++)
	{
		int j=pi[i-1];
		while(j>0 && s[i]!=s[j])
			j=pi[j-1];
		if(s[i]==s[j])
			j++;
		pi[i]=j;
	}
	return pi;
}
string IntToStr(int a)
{
	string str1="",str2="";
	int b=1,x=1;
	if(a==0)
		str1+=char(0+48);
	while(a/b!=0)
	{
		b*=10;
		str1+=char(a%b/x+48);
		x*=10;
	}
	for(int i=str1.size()-1;i>=0;i--)
        str2+=str1[i];
    return str2;
}
string max_palindrome(string s)
{
	int n=s.length();
	string max_string;
	vector<int> d1(n);
	int l=0,r=-1;
	for(int i=0;i<n;++i){
		int k=(i>r ? 1 : (min(d1[l+r-i],r-i)));
		while (i+k<n && i-k>=0 && s[i+k]==s[i-k]) ++k;
		d1[i]=k--;
		if (i+k > r)
		l=i-k,r=i+k-1;
	}

	vector<int> d2(n);
	l=0;r=-1;
	for(int i=0;i<n;++i)
	{
		int k=(i>r ? 0 : (min(d2[l+r-i+1],r-i+1)))+1;
		while(i+k-1<n && i-k>=0 && s[i+k-1]==s[i-k])k++;
		d2[i]=--k;
		if(i+k-1>r)
		{l=i-k;r=i+k-1;}
	}
	int max1=-1,max1_index;
	for(int i=0;i<d1.size();i++)
	{
		if(d1[i]>max1)
		{
			max1=d1[i];
			max1_index=i;
		}
	}
	int max2=-1,max2_index;
	for(int i=0;i<d2.size();i++)
	{
		if(d2[i]>max2)
		{
			max2=d2[i];
			max2_index=i;
		}
	}
	int m1=(max1_index-max1+1),m2=(max2_index-max2),i1=(max1*2-1),i2=(max2*2);
	if(i1>i2)
	{
		max_string=s.substr(m1,i1);
	}
	else
	{
		max_string=s.substr(m2,i2);
	}
	return max_string;
}
vector<int> circular_shift(vector<int> a, int n)
{
	vector<int> res(a.size());
	for(int i=0;i<a.size();i++)
	{
		res[(i+n)%res.size()]=a[i];
	}
	return res;
}
struct point
{
	double x;
	double y;
};
int main()
{

	int n,x;
	cin >> n >> x;
	int temp;
	int sum=0;
	for(int i=0;i<n;i++)
	{
		cin >> temp;
		sum+=temp;
	}
	if((abs(sum))%x==0)
		cout << abs(sum)/x << endl;
	else
		cout << abs(sum)/x+1 << endl;
	return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include<set>
#include<math.h>
using namespace std;

int main()
{
    int n,x;
    cin >> n >> x;
    double temp,m1=0,m2=0,temp2;
    double temp3;
    for(int i=0; i<n; i++)
    {
        cin >> temp;
        if(temp >=0)
        {
            m1+=temp;
        }
        else
        {
            m2+=temp;
        }
    }
    temp2=abs(m1+m2);
    if(temp2<=x)
    {
        cout << 1 << endl;

    }
    else
    {
        temp3=temp2/x;
        if(temp3>(int)temp3)
            (int)temp3++;
        cout << (int)temp3 <<endl;
    }
    return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include<set>
#include<math.h>
using namespace std;

int main()
{
    int n,x;
    cin >> n >> x;
    double temp,m1=0,m2=0,temp2;
    double temp3;
    for(int i=0; i<n; i++)
    {
        cin >> temp;
        if(temp >=0)
        {
            m1+=temp;
        }
        else
        {
            m2+=temp;
        }
    }
    temp2=abs(m1+m2);
    if(temp2==0)
    {cout << 0;return 0;}
    if(temp2<=x)
    {
        cout << 1 << endl;

    }
    else
    {
        temp3=temp2/x;
        if(temp3>(int)temp3)
            (int)temp3++;
        cout << (int)temp3 <<endl;
    }
    return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include<set>
#include<math.h>
using namespace std;

int main()
{
    int n,x;
    cin >> n >> x;
    int temp,m1=0,m2=0,temp2,temp3;
    for(int i=0; i<n; i++)
    {
        cin >> temp;
        if(temp >=0)
        {
            m1+=temp;
        }
        else
        {
            m2+=temp;
        }
    }
    temp2=abs(m1+m2);
    if(temp2<=x)
    {
        cout << 1 << endl;

    }
    else
    {
        temp3=temp2/x;
        if((double)(temp2/x)>temp2/x)
            temp3++;
        cout << temp3 <<endl;
    }
    return 0;
}


#include <iostream>
#include <stdio.h>
#include <math.h>

using namespace std;

int ans, sum, x, n, q;

int main()

{
    scanf("%d %d", &n, &x);
    sum = 0;
    for (int i = 0; i < n; i++)
    {
        cin>>q;
        sum += q;
    }
    sum = abs(sum);
    ans = sum / x;
    if (sum % x != 0) ans++;
    cout<<ans<<endl;
}


#include <bits/stdc++.h>

using namespace std;

int ans, sum, x, n, q;

int main()

{
    scanf("%d %d", &n, &x);
    sum = 0;
    for (int i = 0; i < n; i++)
    {
        cin>>q;
        sum += q;
    }
    sum = abs(sum);
    ans = sum / x;
    if (sum % x != 0) ans++;
    cout<<ans<<endl;
}


#include <iostream>
#include <stdio.h>
#include <math>

using namespace std;

int ans, sum, x, n, q;

int main()

{
    scanf("%d %d", &n, &x);
    sum = 0;
    for (int i = 0; i < n; i++)
    {
        cin>>q;
        sum += q;
    }
    sum = abs(sum);
    ans = sum / x;
    if (sum % x != 0) ans++;
    cout<<ans<<endl;
}


#include <iostream>
#include <stdio.h>
#include <math.h>
#include <string>
#include <algorithm>
#include <set>
#include <queue>
#include <map>
#include <iomanip>
#include <sstream>
#define endl "\n"

using namespace std;
typedef long long ll;
typedef unsigned long long ull;

int n,x;

int main()
{
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
#endif
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	cin>>n>>x;
	int sum = 0;
	for(int i=0; i<n; i++)
	{
		int k;
		cin>>k;
		sum+=k;
	}

	if(!sum)
		cout<<"0"<<endl;
	else
	{
		sum = abs(sum);

		int cnt = 1;
		while(sum>x)
		{
			cnt++;
			sum-=x;
		}

		cout<<cnt<<endl;
	}
	return 0;
}


#include <iostream>
#include <stdio.h>
#include <math.h>
#include <string>
#include <algorithm>
#include <set>
#include <queue>
#include <map>
#include <iomanip>
#include <sstream>
#define endl "\n"

using namespace std;
typedef long long ll;
typedef unsigned long long ull;

int n,x;

int main()
{
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
#endif
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	cin>>n>>x;
	int sum = 0;
	for(int i=0; i<n; i++)
	{
		int k;
		cin>>k;
		sum+=k;
	}

	sum = abs(sum);

	int cnt = 1;
	while(sum>x)
	{
		cnt++;
		sum-=x;
	}

	cout<<cnt<<endl;
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <climits>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <vector>
#include <list>
#define rep(i,m,n) for(i=m;i<=n;i++)
#define rsp(it,s) for(set<int>::iterator it=s.begin();it!=s.end();it++)
#define mod 1000000007
#define inf 0x3f3f3f3f
#define vi vector<int>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define ll long long
#define ld long double
#define pi acos(-1.0)
#define pii pair<int,int>
#define Lson L, mid, ls[rt]
#define Rson mid+1, R, rs[rt]
#define sys system("pause")
#define freopen freopen("in.txt","r",stdin)
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
using namespace std;
ll n, a[10010], b, c, cnt;
bool ch1, ch2, ch, ok1, ok2, ok, checked;
string s[1000100], s1, s2, anss[100100];
vector<string> ans, v;
map<int, int> myMap;
template <typename T>
string NumberToString ( T Number ) {
	ostringstream ss;
	ss << Number;
	return ss.str();
}
int main()
{
    int x;
    cin >> n >> x;
	for(int i = 0; i < n; i++) {
        cin >> a[i];
        if(a[i] < 0) {
            //int cur = a[i] * (-1);
            myMap[abs(a[i])]--;
        } else {
            myMap[a[i]]++;
        }
	}
	for(auto i = myMap.begin(); i != myMap.end(); i++) {
        //cout << i -> first << " " << i -> second << endl;
        cnt += abs(i -> second);
	}
	cout << cnt;
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <climits>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <vector>
#include <list>
#define rep(i,m,n) for(i=m;i<=n;i++)
#define rsp(it,s) for(set<int>::iterator it=s.begin();it!=s.end();it++)
#define mod 1000000007
#define inf 0x3f3f3f3f
#define vi vector<int>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define ll long long
#define ld long double
#define pi acos(-1.0)
#define pii pair<int,int>
#define Lson L, mid, ls[rt]
#define Rson mid+1, R, rs[rt]
#define sys system("pause")
#define freopen freopen("in.txt","r",stdin)
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
using namespace std;
ll n, a[10010], b, c, cnt;
bool ch1, ch2, ch, ok1, ok2, ok, checked;
string s[1000100], s1, s2, anss[100100];
vector<string> ans, v;
map<int, int> myMap;
template <typename T>
string NumberToString ( T Number ) {
	ostringstream ss;
	ss << Number;
	return ss.str();
}
int main()
{
    int x;
    cin >> n >> x;
	int sum = 0;
	for(int i = 0; i < n; i++) {
        cin >> a[i];
        sum += a[i];
	}
	int answer = sum / x + sum % x;
	cout << abs(answer);
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <climits>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <vector>
#include <list>
#define rep(i,m,n) for(i=m;i<=n;i++)
#define rsp(it,s) for(set<int>::iterator it=s.begin();it!=s.end();it++)
#define mod 1000000007
#define inf 0x3f3f3f3f
#define vi vector<int>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define ll long long
#define ld long double
#define pi acos(-1.0)
#define pii pair<int,int>
#define Lson L, mid, ls[rt]
#define Rson mid+1, R, rs[rt]
#define sys system("pause")
#define freopen freopen("in.txt","r",stdin)
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
using namespace std;
ll n, a[10010], b, c, cnt;
bool ch1, ch2, ch, ok1, ok2, ok, checked;
string s[1000100], s1, s2, anss[100100];
vector<string> ans, v;
map<int, int> myMap;
template <typename T>
string NumberToString ( T Number ) {
	ostringstream ss;
	ss << Number;
	return ss.str();
}
int main()
{
    int x;
    cin >> n >> x;
	int sum = 0;
	for(int i = 0; i < n; i++) {
        cin >> a[i];
        sum += a[i];
	}
	int answer = abs(sum) / x;
	if(abs(sum) % x > 0) answer ++;
	cout << abs(answer);
    return 0;
}


#include <iostream>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <ctime>
using namespace std;

int n,x;
int a,sum=0;
int main()
{
	cin>>n>>x;
	for(int i=0;i<n;i++)
	{
		cin>>a;
		sum+=a;
	}
	if(!sum)
		cout<<0<<endl;
	else
		cout<<(abs(sum)-1)/x+1<<endl;
	return 0;
}


#include <iostream>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <ctime>
using namespace std;

int n,x;
int a,sum=0;
int main()
{
	cin>>n>>x;
	for(int i=0;i<n;i++)
	{
		cin>>a;
		sum+=a;
	}
	if(!sum)
		cout<<0<<endl;
	else
		cout<<abs(sum-1)/x+1<<endl;
	return 0;
}