stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<iostream>

#include<bitset>

#include<cstring>

using namespace std;

const int maxn = 1e5+5;



int main(){

	string s;

	cin >> s;

    bitset<maxn>bit (s);

    string s1,s2;

    for (int i = 1; i <= s.size(); i++) {

    	if (i%2) {

    		s1 += '0';

    		s2 += '1';

    	}else{

    		s1 += '1';

    		s2 += '0';

    	}

    }

    bitset<maxn>tar1 (s1);

    bitset<maxn>tar2 (s2);

    tar1 = tar1^bit;

    tar2 = tar2^bit;

    int a = tar1.count();

    int b = tar2.count();

    cout << min(a,b);

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.1224139110215563x):
#include <bits/stdc++.h>



using namespace std;



int main(){

	int ans = 0;

	string s;

	cin >> s;



	for(int i=1;i<s.size();++i){

		if(s[i] == s[i-1]){

			ans++;

			if(s[i-1] == '0') s[i] = '1';

			else s[i] = '0';

		}

	}



	cout << ans << '\n';



	return 0;

}
// Slower C++ solution:
#include<iostream>

#include<bitset>

#include<cstring>

using namespace std;

const int maxn = 1e5+5;



int main(){

	string s;

	cin >> s;

    bitset<maxn>bit (s);

    string s1,s2;

    for (int i = 1; i <= s.size(); i++) {

    	if (i%2) {

    		s1 += '0';

    		s2 += '1';

    	}else{

    		s1 += '1';

    		s2 += '0';

    	}

    }

    bitset<maxn>tar1 (s1);

    bitset<maxn>tar2 (s2);

    tar1 = tar1^bit;

    tar2 = tar2^bit;

    int a = tar1.count();

    int b = tar2.count();

    cout << min(a,b);

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.0954627583672127x):
#include <bits/stdc++.h>

using namespace std;





#define vi vector<int>

#define pb push_back

#define pii pair<int, int>

#define mp make_pair

#define ll long long





string gera_r( char ini, int len ) {

	string r = "";

	r += ini;

	for ( int i = 1; i < len; i++ ) {

		r += r[i - 1] == '0' ? '1' : '0';

	}



	return r;

}





int main() {

    ios::sync_with_stdio(0);

    cin.tie(0);

    cout.tie(0);

    

    string s;

    int trocas = 0;

    cin >> s;

    int n = s.size();

    string r = gera_r(s[0], n);



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

    	if ( s[i] != r[i] ) {

    		trocas++;

    	}

    }



    cout << trocas << endl;



    return 0;

}
// Slower C++ solution:
#include<iostream>

#include<bitset>

#include<cstring>

using namespace std;

const int maxn = 1e5+5;



int main(){

	string s;

	cin >> s;

    bitset<maxn>bit (s);

    string s1,s2;

    for (int i = 1; i <= s.size(); i++) {

    	if (i%2) {

    		s1 += '0';

    		s2 += '1';

    	}else{

    		s1 += '1';

    		s2 += '0';

    	}

    }

    bitset<maxn>tar1 (s1);

    bitset<maxn>tar2 (s2);

    tar1 = tar1^bit;

    tar2 = tar2^bit;

    int a = tar1.count();

    int b = tar2.count();

    cout << min(a,b);

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.1209911245173414x):
#include <bits/stdc++.h>



using namespace std;



int main(int qtd, char* nome[])

{

    string p;

    cin >> p;



    char color = p[0];

    int ans = 0;

    for (int i = 1; i < p.size(); i++){

        if(color == p[i]){

            ans++;

            if (p[i] == '0')

                p[i] = '1';

            else

                p[i] = '0';

        }

        color = p[i];

    }

    cout << ans << endl;



    return 0;

}
// Slower C++ solution:
#include<iostream>

#include<bitset>

#include<cstring>

using namespace std;

const int maxn = 1e5+5;



int main(){

	string s;

	cin >> s;

    bitset<maxn>bit (s);

    string s1,s2;

    for (int i = 1; i <= s.size(); i++) {

    	if (i%2) {

    		s1 += '0';

    		s2 += '1';

    	}else{

    		s1 += '1';

    		s2 += '0';

    	}

    }

    bitset<maxn>tar1 (s1);

    bitset<maxn>tar2 (s2);

    tar1 = tar1^bit;

    tar2 = tar2^bit;

    int a = tar1.count();

    int b = tar2.count();

    cout << min(a,b);

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.0966737192280303x):
#include <iostream>

#include <string>



using namespace std;



int main(){

    ios::sync_with_stdio(false);

    int o = 0;

    string s;

    cin>>s;

    for (int i = 1; i < s.size(); ++i){

    	if(s[i-1] == s[i]){

    		s[i] = (s[i] - '0' + 1)%2 + '0';

    		o++; 

    	}

    }

    cout << o << endl;

}
// Slower C++ solution:
#include<iostream>

#include<bitset>

#include<cstring>

using namespace std;

const int maxn = 1e5+5;



int main(){

	string s;

	cin >> s;

    bitset<maxn>bit (s);

    string s1,s2;

    for (int i = 1; i <= s.size(); i++) {

    	if (i%2) {

    		s1 += '0';

    		s2 += '1';

    	}else{

    		s1 += '1';

    		s2 += '0';

    	}

    }

    bitset<maxn>tar1 (s1);

    bitset<maxn>tar2 (s2);

    tar1 = tar1^bit;

    tar2 = tar2^bit;

    int a = tar1.count();

    int b = tar2.count();

    cout << min(a,b);

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.122950790523486x):
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;



const int N = 1e2 + 5, mod = 1e9 + 7;



int main()

{

    //ios::sync_with_stdio(false);cin.tie(nullptr);ios_base::sync_with_stdio(false);

    string s;

    cin >> s;

    int ans1 = 0, ans2 = 0;

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

    {

        ans1 += s[i] != '0' + i % 2;

        ans2 += s[i] == '0' + i % 2;

    }

    cout << min(ans1, ans2);

    return 0;

}
// Slower C++ solution:
#include<iostream>

#include<bitset>

#include<cstring>

using namespace std;

const int maxn = 1e5+5;



int main(){

	string s;

	cin >> s;

    bitset<maxn>bit (s);

    string s1,s2;

    for (int i = 1; i <= s.size(); i++) {

    	if (i%2) {

    		s1 += '0';

    		s2 += '1';

    	}else{

    		s1 += '1';

    		s2 += '0';

    	}

    }

    bitset<maxn>tar1 (s1);

    bitset<maxn>tar2 (s2);

    tar1 = tar1^bit;

    tar2 = tar2^bit;

    int a = tar1.count();

    int b = tar2.count();

    cout << min(a,b);

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.1056514817652516x):
#include<iostream>

#include <bits/stdc++.h>

#define ll long long

#define ld long double

#define IO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;

int n, ans1, ans2, c1, c2=1;

string s;

int main()

{

    IO

    cin>>s;

    n=s.size();

    for(int i=0; i<n; i++)

    {

        if(s[i]-'0'!=c1)

            ans1++;

        if(s[i]-'0'!=c2)

            ans2++;

        c1=1-c1;

        c2=1-c2;

    }

    cout<<min(ans1,ans2);

}
// Slower C++ solution:
#include<iostream>

#include<bitset>

#include<cstring>

using namespace std;

const int maxn = 1e5+5;



int main(){

	string s;

	cin >> s;

    bitset<maxn>bit (s);

    string s1,s2;

    for (int i = 1; i <= s.size(); i++) {

    	if (i%2) {

    		s1 += '0';

    		s2 += '1';

    	}else{

    		s1 += '1';

    		s2 += '0';

    	}

    }

    bitset<maxn>tar1 (s1);

    bitset<maxn>tar2 (s2);

    tar1 = tar1^bit;

    tar2 = tar2^bit;

    int a = tar1.count();

    int b = tar2.count();

    cout << min(a,b);

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.1219982615296376x):
#include<bits/stdc++.h>

#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);



using namespace std;



using ll = long long;



int main() {

    // freopen('b.txt', 'r', stdin);

    // fastio;



    string S;

    cin >> S;



    int n = S.size();



    string s1, s2;

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

        if (i % 2 == 0)

            s1 += '0', s2 += '1';

        else

            s2 += '0', s1 += '1';

    }



    int d1 = 0, d2 = 0;

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

        if (S[i] != s1[i])

            d1 ++;

        if (S[i] != s2[i])

            d2 ++;

    }



    cout << min(d1, d2) << '\n';



    return 0;

}
// Slower C++ solution:
#include<iostream>

#include<bitset>

#include<cstring>

using namespace std;

const int maxn = 1e5+5;



int main(){

	string s;

	cin >> s;

    bitset<maxn>bit (s);

    string s1,s2;

    for (int i = 1; i <= s.size(); i++) {

    	if (i%2) {

    		s1 += '0';

    		s2 += '1';

    	}else{

    		s1 += '1';

    		s2 += '0';

    	}

    }

    bitset<maxn>tar1 (s1);

    bitset<maxn>tar2 (s2);

    tar1 = tar1^bit;

    tar2 = tar2^bit;

    int a = tar1.count();

    int b = tar2.count();

    cout << min(a,b);

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.113581651522705x):
#include<bits/stdc++.h>

#define FRU freopen("out.txt","w",stdout)

#define FRO freopen("in.txt","r",stdin)

#define pb push_back

#define mp make_pair

#define ff first

#define ss second

#define mem(ara,n) memset(ara,n,sizeof ara)

#define loop(i,j,n) for(i=j;i<n;i++)

#define rloop(i,j,n) for(i=n;i>=j;i--)

#define INF 2147483647

#define ll long long

#define pii pair<int,int>

#define eps 1e-9

#define mii map<int,int>

#define vi vector<int>

#define all(n) n.begin(),n.end()

#define inf INF

#define INFLL 9223372036854775807

using namespace std;

int main()

{

    int n,m,cnt=0,i,j,k,tc,t;

    string s,s1,s2;

    cin>>s;

    n=s.length();

    s1.pb('0');

    s2.pb('1');

    for(i=1;i<n;i++)

    {

        s1.pb(s1[i-1]=='0'?'1':'0' );

        s2.pb(s2[i-1]=='0'?'1':'0' );

    }

    int cnt1=0,cnt2=0;

    for(i=0;i<n;i++)

    {

        if(s[i]!=s1[i])cnt1++;

        if(s[i]!=s2[i])cnt2++;

    }

    cout<<min(cnt1,cnt2);



}
// Slower C++ solution:
#include<iostream>

#include<bitset>

#include<cstring>

using namespace std;

const int maxn = 1e5+5;



int main(){

	string s;

	cin >> s;

    bitset<maxn>bit (s);

    string s1,s2;

    for (int i = 1; i <= s.size(); i++) {

    	if (i%2) {

    		s1 += '0';

    		s2 += '1';

    	}else{

    		s1 += '1';

    		s2 += '0';

    	}

    }

    bitset<maxn>tar1 (s1);

    bitset<maxn>tar2 (s2);

    tar1 = tar1^bit;

    tar2 = tar2^bit;

    int a = tar1.count();

    int b = tar2.count();

    cout << min(a,b);

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.097189634895671x):
#include<bits/stdc++.h>

using namespace std;



#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)

#define ll long long 

#define F(n) for(int i = 0; i < n; ++i)

#define Debug cout<<endl<<"I AM IRONMAN"<<endl



int main ()

{

    fastio;

    string a;

    cin >> a;

    int p1=0,p2=0;

    for(int i=0;i<a.length();i++)

    {

        if(i%2==0 && a[i]=='0')

        {

            p1++;

        }

        if(i%2==1 && a[i]=='1')

        {

            p1++;

        }

        

    }

    for(int i=0;i<a.length();i++)

    {

        if(i%2==0 && a[i]=='1')

        {

            p2++;

        }

        if(i%2==1 && a[i]=='0')

        {

            p2++;

        }

        

    }

    cout << min(p1,p2);

    return 0;

}
// Slower C++ solution:
#include<iostream>

#include<bitset>

#include<cstring>

using namespace std;

const int maxn = 1e5+5;



int main(){

	string s;

	cin >> s;

    bitset<maxn>bit (s);

    string s1,s2;

    for (int i = 1; i <= s.size(); i++) {

    	if (i%2) {

    		s1 += '0';

    		s2 += '1';

    	}else{

    		s1 += '1';

    		s2 += '0';

    	}

    }

    bitset<maxn>tar1 (s1);

    bitset<maxn>tar2 (s2);

    tar1 = tar1^bit;

    tar2 = tar2^bit;

    int a = tar1.count();

    int b = tar2.count();

    cout << min(a,b);

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.1232979111427746x):
#include <bits/stdc++.h>

using namespace std;

 

int main()

{

    string s;

    cin >> s;

 

    long int N = s.size();

 

    long int m1ve = 0;

    long int m2ve = 0;

 

    for(long int n=0; n<N; n++)

    {

        if(n % 2)

        {

            if(s[n] == '1')

            {

                m1ve++;

            }

 

            else

            {

                m2ve++;

            }

        }

 

        else

        {

            if(s[n] == '1')

            {

                m2ve++;

            }

 

            else

            {

                m1ve++;

            }

        }

    }

 

    cout << min(m1ve,m2ve);

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h> 



using namespace std; 



int main(){

	string s;

	cin >> s;

	int cnt=0;



	int x=s[0];



	for(int i=1; i<s.size(); i++){

		if(x=='0'){

			if(s[i]=='1'){

				// flag=1;

			}else{

				s[i]='1';

				cnt++;

			}

		}else{

			if(s[i]=='0'){

				// flag==2;

			}else{

				s[i]='0';

				cnt++;

			}

		}

		x=s[i];

	}



	cout << cnt;



return 0;



}





















// int main()

// {		

// 	float a,b,c;

// 	cin >> a >> b >> c;



// 	float n = ((b-a)/c)+1;





// 	if(c==0 && a==b)

// 		cout << "YES";

// 	else if(c==0 && a!=b)

// 		cout << "NO";

// 	else if((b<0 && c>=0) || (b>=0 && c<0))

// 		cout << "NO";

// 	else{

// 		if(floor(n)==ceil(n))

// 		cout << "YES";

// 	else

// 		cout << "NO";

// 	}



// }


// Faster C++ solution for the same problem (measured speedup: 5.277850745757976x):
#include <stdio.h>

int main (){

	

	char s[100000];

	int count = 0;

	



		scanf("%s", &s);

	

	

	for (int j = 0; s[j+1] != '\0'; j++){

		if(s[j] == s[j+1] && s[j] == s[j-1]){

//		if(s[j] == s[j+1]){

			if(s[j] == '0'){

				s[j] = '1';

			}

			else{

				s[j] = '0';

			}

			count++;

		}

		else if(s[j] == s[j+1] && s[j] != s[j-1]){

			if(s[j+1] == '0'){

				s[j+1] = '1';

			}

			else{

				s[j+1] = '0';

			}

			count++;

	   	}

	}

	

	

	printf("%d", count);

	

	

	

	

	

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



#define trace(...) __f( #__VA_ARGS__ , __VA_ARGS__ )

template <typename Arg1>

void __f( const char* name , Arg1&& arg1 ) {

        cerr << name << " : " << arg1 << "\n";

}

template <typename Arg1, typename... Args>

void __f( const char* na , Arg1&& arg1 , Args&&... args ) {

        const char* c = strchr( na + 1 , ',' );

        cerr.write( na , c - na ) << " : " << arg1 << " , ";

        __f( c + 1 , args... );

}

#define endl "\n"

#define all(V) V.begin(),V.end()

#define Unique(V) sort(all(V)),V.erase(unique(all(V)),V.end())

#define IO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

typedef long long int LL;

typedef pair <int,int> pii;

const int MOD = 1e9 + 7;

const int inf = 1e9;

const double EPS = 1e-9;

const double PI = acos(-1.0);

const long long INF = 1e18;

const int N = 1e5 + 5;



int main( ) {

        IO;

        #ifdef LOCAL

            //freopen( "input.txt" , "r" , stdin );

        #endif // LOCAL

        string s;

        cin >> s;

        int ans = 0;

        for( int i = 1; i < s.size(); i++ ) {

                if( s[i] == s[i - 1] ) {

                        if( s[i] == '1' ) s[i] = '0';

                        else s[i] = '1';

                        ans++;

                }

        }

        cout << ans << endl;

        return 0;

}




















// Faster C++ solution for the same problem (measured speedup: 5.372759204714913x):
#include <stdio.h>

int main (){

	

	char s[100000];

	int count = 0;

	



		scanf("%s", &s);

	

	

	for (int j = 0; s[j+1] != '\0'; j++){

		if(s[j] == s[j+1] && s[j] == s[j-1]){

//		if(s[j] == s[j+1]){

			if(s[j] == '0'){

				s[j] = '1';

			}

			else{

				s[j] = '0';

			}

			count++;

		}

		else if(s[j] == s[j+1] && s[j] != s[j-1]){

			if(s[j+1] == '0'){

				s[j+1] = '1';

			}

			else{

				s[j+1] = '0';

			}

			count++;

	   	}

	}

	

	

	printf("%d", count);

	

	

	

	

	

	return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

int main(){

	char brick[100010];

	int cnt1=0,cnt2=0;

	int l=0;

	int flag=0;

	cin>>brick;

	while(brick[l])l++;

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

		if(brick[i]-'0'!=flag)cnt1++;

		flag=1-flag;

	} 

	flag=1;

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

		if(brick[i]-'0'!=flag)cnt2++;

		flag=1-flag;

	} 

	cout<<(cnt1>cnt2?cnt2:cnt1);

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.276580932774858x):
#include <stdio.h>

int main (){

	

	char s[100000];

	int count = 0;

	



		scanf("%s", &s);

	

	

	for (int j = 0; s[j+1] != '\0'; j++){

		if(s[j] == s[j+1] && s[j] == s[j-1]){

//		if(s[j] == s[j+1]){

			if(s[j] == '0'){

				s[j] = '1';

			}

			else{

				s[j] = '0';

			}

			count++;

		}

		else if(s[j] == s[j+1] && s[j] != s[j-1]){

			if(s[j+1] == '0'){

				s[j+1] = '1';

			}

			else{

				s[j+1] = '0';

			}

			count++;

	   	}

	}

	

	

	printf("%d", count);

	

	

	

	

	

	return 0;

}
// Slower C++ solution:
/**

     **author : _KMS_

     **created : 12-03-2020

**/

#include<bits/stdc++.h>

using namespace std;

const long long M =1e5+100,MOD=2e9;

typedef long long ll;

string s;

int main() 

{ 

      

 ios::sync_with_stdio(false);

 cin.tie(0);

 cin>>s;

 int cnt=0,cnt2=0;

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

 {

       if(i%2==0&&s[i]=='0')cnt++;

       else if(i%2==1&&s[i]=='1')cnt++;

 }

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

 {

       if(i%2==0&&s[i]=='1')cnt2++;

       else if(i%2==1&&s[i]=='0')cnt2++;

 }

 cout<<min(cnt,cnt2)<<"\n";

 



 

	return 0; 

} 

// Faster C++ solution for the same problem (measured speedup: 5.374435157120984x):
#include <stdio.h>

int main (){

	

	char s[100000];

	int count = 0;

	



		scanf("%s", &s);

	

	

	for (int j = 0; s[j+1] != '\0'; j++){

		if(s[j] == s[j+1] && s[j] == s[j-1]){

//		if(s[j] == s[j+1]){

			if(s[j] == '0'){

				s[j] = '1';

			}

			else{

				s[j] = '0';

			}

			count++;

		}

		else if(s[j] == s[j+1] && s[j] != s[j-1]){

			if(s[j+1] == '0'){

				s[j+1] = '1';

			}

			else{

				s[j+1] = '0';

			}

			count++;

	   	}

	}

	

	

	printf("%d", count);

	

	

	

	

	

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



int notnumber(int a) {

  if(a == 48) return 49;

  else return 48;

}



int main() {

  string s;

  cin >> s;



  int cont = 0;

  int ant = s[0];



  for(int i = 1; i < s.length(); i++) {

    if(s[i] == ant) {

      ant = notnumber(s[i]);

      cont++;

    } else ant = s[i];

  }



  ant = s[s.length()-1];

  int cont2 = 0;



  for(int i = s.length()-2; i >= 0; i--) {

    if(s[i] == ant) {

      ant = notnumber(s[i]);

      cont2++;

    } else ant = s[i];

  }



  cout << min(cont, cont2) << endl;



  return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.331599979470627x):
#include <stdio.h>

int main (){

	

	char s[100000];

	int count = 0;

	



		scanf("%s", &s);

	

	

	for (int j = 0; s[j+1] != '\0'; j++){

		if(s[j] == s[j+1] && s[j] == s[j-1]){

//		if(s[j] == s[j+1]){

			if(s[j] == '0'){

				s[j] = '1';

			}

			else{

				s[j] = '0';

			}

			count++;

		}

		else if(s[j] == s[j+1] && s[j] != s[j-1]){

			if(s[j+1] == '0'){

				s[j+1] = '1';

			}

			else{

				s[j+1] = '0';

			}

			count++;

	   	}

	}

	

	

	printf("%d", count);

	

	

	

	

	

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>



// # DEFINES # //

#define ll long long

#define M (ll)1e9+7

#define EPS 1e-9



using namespace std;



int main(){

    ios::sync_with_stdio(0);

    cin.tie(0);

    cout.tie(0);



    string s;



    cin >> s;



    size_t n = s.size();

    

    // primeiro 1

    int n1 = 0;

    for(int i = 1; i <= n; i++) {

        if(i % 2 == 1 && s[i-1] != '1')

            n1++;

        else if(i % 2 == 0 && s[i-1] != '0')

            n1++;

    }



    // primeiro 0

    int n2 = 0;    

    for(int i = 1; i <= n; i++) {

        if(i % 2 == 1 && s[i-1] != '0')

            n2++;

        else if(i % 2 == 0 && s[i-1] != '1')

            n2++;

    }



    if(n == 1)

        cout << 0 << endl;

    else 

        cout << min(n1, n2) << endl;



    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.40804749983605x):
#include <stdio.h>

int main (){

	

	char s[100000];

	int count = 0;

	



		scanf("%s", &s);

	

	

	for (int j = 0; s[j+1] != '\0'; j++){

		if(s[j] == s[j+1] && s[j] == s[j-1]){

//		if(s[j] == s[j+1]){

			if(s[j] == '0'){

				s[j] = '1';

			}

			else{

				s[j] = '0';

			}

			count++;

		}

		else if(s[j] == s[j+1] && s[j] != s[j-1]){

			if(s[j+1] == '0'){

				s[j+1] = '1';

			}

			else{

				s[j+1] = '0';

			}

			count++;

	   	}

	}

	

	

	printf("%d", count);

	

	

	

	

	

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>



using namespace std;



#define ll long long

#define ull unsigned long long

#define PI acos(-1.0)

#define eps 1e-12

#define fi first

#define se second

#define pb push_back

#define MEM(a,b) memset((a),(b),sizeof(a))

#define mod(x) ((x)%MOD)

#define pii pair<int,int>

#define wz cout<<"-----"<<endl;

const int INF_INT = 2147483647;

const ll INF_LL = 9223372036854775807LL;

const ull INF_ULL = 18446744073709551615Ull;

const ll P = 92540646808111039LL;



const ll maxn = 1e5 + 10, MOD = 1e9 + 7;

const int Move[4][2] = {-1,0,1,0,0,1,0,-1};

const int Move_[8][2] = {-1,-1,-1,0,-1,1,0,-1,0,1,1,-1,1,0,1,1};



inline int read(){

    int x=0,f=1;char ch=getchar();

    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}

    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}

    return x*f;

}





void init() {



}



vector<int>E[maxn];





int main(){

//    freopen("C:\\Users\\Administrator\\Desktop\\in.txt","r",stdin);

//    freopen("C:\\Users\\Administrator\\Desktop\\out.txt","w",stdout);

//    ios_base::sync_with_stdio(0);

    init();

    int n,m; cin >>n >>m;

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

        int x, y; cin >> x >> y;

        E[x].pb(y);

        E[y].pb(x);

    }

    for (int i = 1; i <= n; i++) {

        cout << E[i].size() << endl;

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 3.530068834718154x):
#include<iostream>

#include<cstring>

using namespace std;

int map[105];

int main()

{

	int n,m;

	cin>>n>>m;

	memset(map,0,sizeof(map));

	while(m--)

	{

		int a,b;

		cin>>a>>b;

		map[a]++;

		map[b]++;

	}

	for(int i=1;i<=n;i++)

		cout<<map[i]<<endl;

}
// Slower C++ solution:
#include<bits/stdc++.h>



using namespace std;



#define ll long long

#define ull unsigned long long

#define PI acos(-1.0)

#define eps 1e-12

#define fi first

#define se second

#define pb push_back

#define MEM(a,b) memset((a),(b),sizeof(a))

#define mod(x) ((x)%MOD)

#define pii pair<int,int>

#define wz cout<<"-----"<<endl;

const int INF_INT = 2147483647;

const ll INF_LL = 9223372036854775807LL;

const ull INF_ULL = 18446744073709551615Ull;

const ll P = 92540646808111039LL;



const ll maxn = 1e5 + 10, MOD = 1e9 + 7;

const int Move[4][2] = {-1,0,1,0,0,1,0,-1};

const int Move_[8][2] = {-1,-1,-1,0,-1,1,0,-1,0,1,1,-1,1,0,1,1};



inline int read(){

    int x=0,f=1;char ch=getchar();

    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}

    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}

    return x*f;

}





void init() {



}



vector<int>E[maxn];





int main(){

//    freopen("C:\\Users\\Administrator\\Desktop\\in.txt","r",stdin);

//    freopen("C:\\Users\\Administrator\\Desktop\\out.txt","w",stdout);

//    ios_base::sync_with_stdio(0);

    init();

    int n,m; cin >>n >>m;

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

        int x, y; cin >> x >> y;

        E[x].pb(y);

        E[y].pb(x);

    }

    for (int i = 1; i <= n; i++) {

        cout << E[i].size() << endl;

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 3.5319717589984116x):
#include<iostream>

using namespace std;

int num[1000010];

int main()

{

    int n,m;

    cin>>n>>m;

    while(m--)

    {

        int a,b;

        cin>>a>>b;

        num[a]++;

        num[b]++;

    }

    for(int i=1;i<=n;i++)

    {

        cout<<num[i]<<endl;

    }

}